Merge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next
[sfrench/cifs-2.6.git] / drivers / hid / hid-debug.c
index c94026768570b7b03f976882b4bbf7044637943b..850d02a7a92539056d85b0b18eba88f8cb73cb38 100644 (file)
@@ -949,8 +949,8 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,
        int ret = 0, len;
        DECLARE_WAITQUEUE(wait, current);
 
+       mutex_lock(&list->read_mutex);
        while (ret == 0) {
-               mutex_lock(&list->read_mutex);
                if (list->head == list->tail) {
                        add_wait_queue(&list->hdev->debug_wait, &wait);
                        set_current_state(TASK_INTERRUPTIBLE);