Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix release of vmem_btag_lock (don't release twice ...



details:   https://anonhg.NetBSD.org/src/rev/3f3e7a5e1fbd
branches:  trunk
changeset: 784746:3f3e7a5e1fbd
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Feb 08 09:30:01 2013 +0000

description:
Fix release of vmem_btag_lock (don't release twice in error path)

diffstat:

 sys/kern/subr_vmem.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r b4542fb03dcf -r 3f3e7a5e1fbd sys/kern/subr_vmem.c
--- a/sys/kern/subr_vmem.c      Fri Feb 08 04:36:35 2013 +0000
+++ b/sys/kern/subr_vmem.c      Fri Feb 08 09:30:01 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_vmem.c,v 1.80 2013/01/29 21:26:24 para Exp $      */
+/*     $NetBSD: subr_vmem.c,v 1.81 2013/02/08 09:30:01 skrll Exp $     */
 
 /*-
  * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi,
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.80 2013/01/29 21:26:24 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.81 2013/02/08 09:30:01 skrll Exp $");
 
 #if defined(_KERNEL)
 #include "opt_ddb.h"
@@ -204,13 +204,11 @@
                mutex_exit(&vmem_btag_lock);
                mutex_exit(&vmem_refill_lock);
                return 0;
-       } else {
-               mutex_exit(&vmem_btag_lock);
        }
+       mutex_exit(&vmem_btag_lock);
 
        if (vmem_alloc(kmem_meta_arena, PAGE_SIZE,
            (flags & ~VM_FITMASK) | VM_INSTANTFIT | VM_POPULATING, &va) != 0) {
-               mutex_exit(&vmem_btag_lock);
                mutex_exit(&vmem_refill_lock);
                return ENOMEM;
        }



Home | Main Index | Thread Index | Old Index