resend: error in hiddev_read when interrupted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

me thinks there is a bug in hiddev_read function.
If the mutex_lock_interruptible will be interrupted by a signal the task is 
left on the wait queue, isn't it?


--- drivers/hid/usbhid/hiddev.c.orig    2011-04-19 21:29:52.000000000 +0200
+++ drivers/hid/usbhid/hiddev.c 2011-04-19 21:35:30.000000000 +0200
@@ -367,8 +367,10 @@
                                /* let O_NONBLOCK tasks run */
                                mutex_unlock(&list->thread_lock);
                                schedule();
-                               if (mutex_lock_interruptible(&list->thread_lock))
+                               if (mutex_lock_interruptible(&list->thread_lock)) {
+                                       finish_wait(&list->hiddev->wait, &wait);
                                        return -EINTR;
+                               }
                                set_current_state(TASK_INTERRUPTIBLE);
                        }
                        finish_wait(&list->hiddev->wait, &wait);
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux