summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-13 19:10:33 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-13 19:10:33 +0200
commit03266d28ca5bf1959ee91dc6554c01b790975352 (patch)
treef98e36f3d3108344a82e9ccdb30790121ed93b5e /drivers/hid/hidraw.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiw... (diff)
parentHID: fix possible deadlock in hidraw_read (diff)
downloadlinux-03266d28ca5bf1959ee91dc6554c01b790975352.tar.xz
linux-03266d28ca5bf1959ee91dc6554c01b790975352.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: fix possible deadlock in hidraw_read HID: fix kerneldoc comment for hid_input_report() HID: add __init/__exit macros to twinhan.c
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index ba05275e5104..cdd136942bca 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -48,10 +48,9 @@ static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count,
char *report;
DECLARE_WAITQUEUE(wait, current);
- while (ret == 0) {
-
- mutex_lock(&list->read_mutex);
+ mutex_lock(&list->read_mutex);
+ while (ret == 0) {
if (list->head == list->tail) {
add_wait_queue(&list->hidraw->wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);