Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Don't mutex_exit() if we didn't mutex_enter().



details:   https://anonhg.NetBSD.org/src/rev/1bf3f60f3fd0
branches:  trunk
changeset: 816814:1bf3f60f3fd0
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Jul 27 05:14:40 2016 +0000

description:
Don't mutex_exit() if we didn't mutex_enter().

Pointed out by coypu. Thanks!

diffstat:

 sys/dev/md.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 104a7aea5c00 -r 1bf3f60f3fd0 sys/dev/md.c
--- a/sys/dev/md.c      Wed Jul 27 04:23:42 2016 +0000
+++ b/sys/dev/md.c      Wed Jul 27 05:14:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.77 2016/07/27 01:09:44 pgoyette Exp $ */
+/*     $NetBSD: md.c,v 1.78 2016/07/27 05:14:40 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.77 2016/07/27 01:09:44 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.78 2016/07/27 05:14:40 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_md.h"
@@ -463,9 +463,9 @@
                bp->b_error = EIO;
                break;
        }
+       mutex_exit(&sc->sc_lock);
 
  done:
-       mutex_exit(&sc->sc_lock);
 
        biodone(bp);
 }



Home | Main Index | Thread Index | Old Index