Commit 03266d28 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: fix possible deadlock in hidraw_read
  HID: fix kerneldoc comment for hid_input_report()
  HID: add __init/__exit macros to twinhan.c
parents ae445b91 b0e14951
...@@ -1066,7 +1066,7 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event); ...@@ -1066,7 +1066,7 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event);
* @type: HID report type (HID_*_REPORT) * @type: HID report type (HID_*_REPORT)
* @data: report contents * @data: report contents
* @size: size of data parameter * @size: size of data parameter
* @interrupt: called from atomic? * @interrupt: distinguish between interrupt and control transfers
* *
* This is data entry for lower layers. * This is data entry for lower layers.
*/ */
......
...@@ -132,12 +132,12 @@ static struct hid_driver twinhan_driver = { ...@@ -132,12 +132,12 @@ static struct hid_driver twinhan_driver = {
.input_mapping = twinhan_input_mapping, .input_mapping = twinhan_input_mapping,
}; };
static int twinhan_init(void) static int __init twinhan_init(void)
{ {
return hid_register_driver(&twinhan_driver); return hid_register_driver(&twinhan_driver);
} }
static void twinhan_exit(void) static void __exit twinhan_exit(void)
{ {
hid_unregister_driver(&twinhan_driver); hid_unregister_driver(&twinhan_driver);
} }
......
...@@ -48,10 +48,9 @@ static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count, ...@@ -48,10 +48,9 @@ static ssize_t hidraw_read(struct file *file, char __user *buffer, size_t count,
char *report; char *report;
DECLARE_WAITQUEUE(wait, current); 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) { if (list->head == list->tail) {
add_wait_queue(&list->hidraw->wait, &wait); add_wait_queue(&list->hidraw->wait, &wait);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment