Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isapnp We need to hold the lock during mpu_find().



details:   https://anonhg.NetBSD.org/src/rev/24ee29b7b468
branches:  trunk
changeset: 771906:24ee29b7b468
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Dec 07 17:35:01 2011 +0000

description:
We need to hold the lock during mpu_find().

diffstat:

 sys/dev/isapnp/mpu_isapnp.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r a192c7ade4da -r 24ee29b7b468 sys/dev/isapnp/mpu_isapnp.c
--- a/sys/dev/isapnp/mpu_isapnp.c       Wed Dec 07 16:26:23 2011 +0000
+++ b/sys/dev/isapnp/mpu_isapnp.c       Wed Dec 07 17:35:01 2011 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: mpu_isapnp.c,v 1.19 2011/11/24 03:35:58 mrg Exp $      */
+/*     $NetBSD: mpu_isapnp.c,v 1.20 2011/12/07 17:35:01 jakllsch Exp $ */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpu_isapnp.c,v 1.19 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpu_isapnp.c,v 1.20 2011/12/07 17:35:01 jakllsch Exp $");
 
 #include "midi.h"
 
@@ -71,12 +71,17 @@
        sc->sc_mpu.ioh = ipa->ipa_io[0].h;
        sc->sc_mpu.lock = &sc->sc_lock;
 
+       mutex_enter(&sc->sc_lock);
+
        if (!mpu_find(&sc->sc_mpu)) {
                aprint_error_dev(self, "find failed\n");
+               mutex_exit(&sc->sc_lock);
                mutex_destroy(&sc->sc_lock);
                return;
        }
 
+       mutex_exit(&sc->sc_lock);
+
        aprint_normal_dev(self, "%s %s\n", ipa->ipa_devident,
               ipa->ipa_devclass);
 



Home | Main Index | Thread Index | Old Index