]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/hid/hidraw.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[linux-2.6.git] / drivers / hid / hidraw.c
index ba05275e5104f7d30771254b82e3f35a48017bfa..cdd136942bcaa9e1435b1d2efc5444bf6f3317fc 100644 (file)
@@ -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);