提交 06268b2a 编写于 作者: P Peter Waechtler 提交者: Jiri Kosina

HID: hiddev: fix error path in hiddev_read when interrupted

hiddev_read: in case mutex_lock_interruptible will be interrupted
remove the task from the wait queue.
Signed-off-by: NPeter Waechtler <pwaechtler@mac.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 35dca5b4
......@@ -367,8 +367,10 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun
/* 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册