summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-06-27 21:21:11 +0000
committerthompsa <thompsa@FreeBSD.org>2009-06-27 21:21:11 +0000
commit6a523f03ea03e31b66264afaf4a531790162a406 (patch)
treeefd0aa8a9b495aa57b6ef1add62e687b9d628588
parent6c6387b0e87b31a0793232918daa3bcaeddd3482 (diff)
downloadFreeBSD-src-6a523f03ea03e31b66264afaf4a531790162a406.zip
FreeBSD-src-6a523f03ea03e31b66264afaf4a531790162a406.tar.gz
Use the correct mutex in umidi_open()
Submitted by: Hans Petter Selasky Approved by: re (kib)
-rw-r--r--sys/dev/sound/usb/uaudio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 44a488f..65a68e6 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -3671,24 +3671,24 @@ umidi_open(struct usb_fifo *fifo, int fflags)
if (usb_fifo_alloc_buffer(fifo, 4, (1024 / 4))) {
return (ENOMEM);
}
- mtx_lock(&Giant);
+ mtx_lock(&chan->mtx);
chan->read_open_refcount++;
sub->read_open = 1;
- mtx_unlock(&Giant);
+ mtx_unlock(&chan->mtx);
}
if (fflags & FWRITE) {
if (usb_fifo_alloc_buffer(fifo, 32, (1024 / 32))) {
return (ENOMEM);
}
/* clear stall first */
- mtx_lock(&Giant);
+ mtx_lock(&chan->mtx);
chan->flags |= UMIDI_FLAG_WRITE_STALL;
chan->write_open_refcount++;
sub->write_open = 1;
/* reset */
sub->state = UMIDI_ST_UNKNOWN;
- mtx_unlock(&Giant);
+ mtx_unlock(&chan->mtx);
}
return (0); /* success */
}
OpenPOWER on IntegriCloud