diff options
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r-- | drivers/hid/hidraw.c | 5 |
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, | |||
48 | char *report; | 48 | char *report; |
49 | DECLARE_WAITQUEUE(wait, current); | 49 | DECLARE_WAITQUEUE(wait, current); |
50 | 50 | ||
51 | while (ret == 0) { | 51 | mutex_lock(&list->read_mutex); |
52 | |||
53 | mutex_lock(&list->read_mutex); | ||
54 | 52 | ||
53 | while (ret == 0) { | ||
55 | if (list->head == list->tail) { | 54 | if (list->head == list->tail) { |
56 | add_wait_queue(&list->hidraw->wait, &wait); | 55 | add_wait_queue(&list->hidraw->wait, &wait); |
57 | set_current_state(TASK_INTERRUPTIBLE); | 56 | set_current_state(TASK_INTERRUPTIBLE); |