Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Always call brelse() on error for breadn() too.



details:   https://anonhg.NetBSD.org/src/rev/43d12c25dfba
branches:  trunk
changeset: 783576:43d12c25dfba
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Dec 30 09:19:24 2012 +0000

description:
Always call brelse() on error for breadn() too.

diffstat:

 sys/kern/vfs_bio.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r cb46e4533893 -r 43d12c25dfba sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Sun Dec 30 03:19:24 2012 +0000
+++ b/sys/kern/vfs_bio.c        Sun Dec 30 09:19:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.241 2012/12/29 21:56:04 christos Exp $   */
+/*     $NetBSD: vfs_bio.c,v 1.242 2012/12/30 09:19:24 hannken Exp $    */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.241 2012/12/29 21:56:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.242 2012/12/30 09:19:24 hannken Exp $");
 
 #include "opt_bufcache.h"
 
@@ -770,12 +770,11 @@
 
        /* Otherwise, we had to start a read for it; wait until it's valid. */
        error = biowait(bp);
-       if (error == 0 && (flags & B_MODIFY) != 0) {
+       if (error == 0 && (flags & B_MODIFY) != 0)
                error = fscow_run(bp, true);
-               if (error) {
-                       brelse(bp, 0);
-                       *bpp = NULL;
-               }
+       if (error) {
+               brelse(bp, 0);
+               *bpp = NULL;
        }
 
        return error;



Home | Main Index | Thread Index | Old Index