diff options
author | tanimura <tanimura@FreeBSD.org> | 2001-04-03 05:15:58 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2001-04-03 05:15:58 +0000 |
commit | 14d1b86bc5e669883d4021555bb617e5710bb176 (patch) | |
tree | 8158db4cdf134df9879892c193b08890d1377bcb | |
parent | b1b355c17729de30a19172f4da691adf266c462f (diff) | |
download | FreeBSD-src-14d1b86bc5e669883d4021555bb617e5710bb176.zip FreeBSD-src-14d1b86bc5e669883d4021555bb617e5710bb176.tar.gz |
Again initialize a mutex well, then lock it.
PR: kern/26188
Submitted by: Jim Bloom <bloom@acm.org>
-rw-r--r-- | sys/dev/sound/isa/mpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/sound/isa/mpu.c b/sys/dev/sound/isa/mpu.c index d417513..0799da5 100644 --- a/sys/dev/sound/isa/mpu.c +++ b/sys/dev/sound/isa/mpu.c @@ -359,6 +359,8 @@ mpu_attach(device_t dev) DEB(printf("mpu: attaching.\n")); + mtx_init(&scp->mtx, "mpumid", MTX_DEF); + /* Allocate the resources, switch to uart mode. */ if (mpu_allocres(scp, dev) || mpu_uartmode(scp)) { mpu_releaseres(scp, dev); @@ -369,7 +371,6 @@ mpu_attach(device_t dev) /* Fill the softc. */ scp->dev = dev; - mtx_init(&scp->mtx, "mpumid", MTX_DEF); scp->devinfo = devinfo = create_mididev_info_unit(MDT_MIDI, &mpu_op_desc, &midisynth_op_desc); /* Fill the midi info. */ @@ -752,6 +753,7 @@ mpu_releaseres(sc_p scp, device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, scp->io_rid, scp->io); scp->io = NULL; } + mtx_destroy(&scp->mtx); } static device_method_t mpu_methods[] = { |