aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/usx2y
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-10-15 10:07:23 +0800
committerTakashi Iwai <tiwai@suse.de>2008-10-15 11:41:04 +0200
commit428ffb7151a4078994b5c01ecbf845954843c1ec (patch)
tree6cabd0a32b8c8d002fa13f02de635c6a3dd2d5c6 /sound/usb/usx2y
parent8825e8e8d09c1fe6352f94c70f6ff73db449ff56 (diff)
ALSA: us122l: fix missing unlock in usb_stream_hwdep_vm_fault()
Should unlock us122l->mutex before returning VM_FAULT_SIGBUS. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y')
-rw-r--r--sound/usb/usx2y/us122l.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index b441fe2cd19..c2515b680f9 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -118,12 +118,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
void *vaddr;
struct us122l *us122l = area->vm_private_data;
struct usb_stream *s;
- int vm_f = VM_FAULT_SIGBUS;
mutex_lock(&us122l->mutex);
s = us122l->sk.s;
if (!s)
- goto out;
+ goto unlock;
offset = vmf->pgoff << PAGE_SHIFT;
if (offset < PAGE_ALIGN(s->read_size))
@@ -131,7 +130,7 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
else {
offset -= PAGE_ALIGN(s->read_size);
if (offset >= PAGE_ALIGN(s->write_size))
- goto out;
+ goto unlock;
vaddr = us122l->sk.write_page + offset;
}
@@ -141,9 +140,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
mutex_unlock(&us122l->mutex);
vmf->page = page;
- vm_f = 0;
-out:
- return vm_f;
+
+ return 0;
+unlock:
+ mutex_unlock(&us122l->mutex);
+ return VM_FAULT_SIGBUS;
}
static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)