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

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:
USB HID: Add ID for eGalax Multitouch used in JooJoo tablet
HID: hiddev: fix memory corruption due to invalid intfdata
HID: hiddev: protect against disconnect/NULL-dereference race
HID: picolcd: correct ordering of framebuffer freeing
HID: picolcd: testing the wrong variable

+20 -6
+1
drivers/hid/hid-core.c
··· 1299 1299 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) }, 1300 1300 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) }, 1301 1301 { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) }, 1302 + { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) }, 1302 1303 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, 1303 1304 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, 1304 1305 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
+9
drivers/hid/hid-egalax.c
··· 159 159 { 160 160 struct egalax_data *td = hid_get_drvdata(hid); 161 161 162 + /* Note, eGalax has two product lines: the first is resistive and 163 + * uses a standard parallel multitouch protocol (product ID == 164 + * 48xx). The second is capacitive and uses an unusual "serial" 165 + * protocol with a different message for each multitouch finger 166 + * (product ID == 72xx). We do not yet generate a correct event 167 + * sequence for the capacitive/serial protocol. 168 + */ 162 169 if (hid->claimed & HID_CLAIMED_INPUT) { 163 170 struct input_dev *input = field->hidinput->input; 164 171 ··· 253 246 static const struct hid_device_id egalax_devices[] = { 254 247 { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, 255 248 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) }, 249 + { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, 250 + USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) }, 256 251 { } 257 252 }; 258 253 MODULE_DEVICE_TABLE(hid, egalax_devices);
+1
drivers/hid/hid-ids.h
··· 188 188 #define USB_VENDOR_ID_DWAV 0x0eef 189 189 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER 0x0001 190 190 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH 0x480d 191 + #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1 0x720c 191 192 192 193 #define USB_VENDOR_ID_ELECOM 0x056e 193 194 #define USB_DEVICE_ID_ELECOM_BM084 0x0061
+2 -2
drivers/hid/hid-picolcd.c
··· 547 547 ref_cnt--; 548 548 mutex_lock(&info->lock); 549 549 (*ref_cnt)--; 550 - may_release = !ref_cnt; 550 + may_release = !*ref_cnt; 551 551 mutex_unlock(&info->lock); 552 552 if (may_release) { 553 - framebuffer_release(info); 554 553 vfree((u8 *)info->fix.smem_start); 554 + framebuffer_release(info); 555 555 } 556 556 } 557 557
+7 -4
drivers/hid/usbhid/hiddev.c
··· 266 266 { 267 267 struct hiddev_list *list; 268 268 struct usb_interface *intf; 269 + struct hid_device *hid; 269 270 struct hiddev *hiddev; 270 271 int res; 271 272 272 273 intf = usb_find_interface(&hiddev_driver, iminor(inode)); 273 274 if (!intf) 274 275 return -ENODEV; 275 - hiddev = usb_get_intfdata(intf); 276 + hid = usb_get_intfdata(intf); 277 + hiddev = hid->hiddev; 276 278 277 279 if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL))) 278 280 return -ENOMEM; ··· 589 587 struct hiddev_list *list = file->private_data; 590 588 struct hiddev *hiddev = list->hiddev; 591 589 struct hid_device *hid = hiddev->hid; 592 - struct usb_device *dev = hid_to_usb_dev(hid); 590 + struct usb_device *dev; 593 591 struct hiddev_collection_info cinfo; 594 592 struct hiddev_report_info rinfo; 595 593 struct hiddev_field_info finfo; ··· 603 601 /* Called without BKL by compat methods so no BKL taken */ 604 602 605 603 /* FIXME: Who or what stop this racing with a disconnect ?? */ 606 - if (!hiddev->exist) 604 + if (!hiddev->exist || !hid) 607 605 return -EIO; 606 + 607 + dev = hid_to_usb_dev(hid); 608 608 609 609 switch (cmd) { 610 610 ··· 892 888 hid->hiddev = hiddev; 893 889 hiddev->hid = hid; 894 890 hiddev->exist = 1; 895 - usb_set_intfdata(usbhid->intf, usbhid); 896 891 retval = usb_register_dev(usbhid->intf, &hiddev_class); 897 892 if (retval) { 898 893 err_hid("Not able to get a minor for this device.");