Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Move dereferences below a NULL test
HID: hiddev, fix lock imbalance

+7 -3
+4 -2
drivers/hid/hid-core.c
··· 1075 1075 */ 1076 1076 int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt) 1077 1077 { 1078 - struct hid_report_enum *report_enum = hid->report_enum + type; 1079 - struct hid_driver *hdrv = hid->driver; 1078 + struct hid_report_enum *report_enum; 1079 + struct hid_driver *hdrv; 1080 1080 struct hid_report *report; 1081 1081 unsigned int i; 1082 1082 int ret; 1083 1083 1084 1084 if (!hid || !hid->driver) 1085 1085 return -ENODEV; 1086 + report_enum = hid->report_enum + type; 1087 + hdrv = hid->driver; 1086 1088 1087 1089 if (!size) { 1088 1090 dbg_hid("empty report\n");
+3 -1
drivers/hid/usbhid/hiddev.c
··· 527 527 goto goodreturn; 528 528 529 529 case HIDIOCGCOLLECTIONINDEX: 530 + i = field->usage[uref->usage_index].collection_index; 531 + unlock_kernel(); 530 532 kfree(uref_multi); 531 - return field->usage[uref->usage_index].collection_index; 533 + return i; 532 534 case HIDIOCGUSAGES: 533 535 for (i = 0; i < uref_multi->num_values; i++) 534 536 uref_multi->values[i] =