aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-24 15:44:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-24 15:44:24 -0400
commit874bf9ee69cdebc1e734a391d6b2fa3e08c9ff87 (patch)
treefffbf36db9260e4e6d0a8e8a286a082c5c94ad04
parent077b20537cdd4983cf180b3a3230157f08f16928 (diff)
parent6debce6f4e787a8eb4cec94e7afa85fb4f40db27 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fixes from Jiri Kosina: - kernel crash fixes for multitouch and wacom drivers, by Brent Adam and Dan Carpenter - cp2112 data packet race condition corruption fix, by Antonio Borneo - a few new device IDs for wacom and microsoft drivers * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: cp2112: fix to force single data-report reply HID: wacom: Enable pad device for older Bamboo Touch tablets HID: multitouch: Fix fields from pen report ID being interpreted for multitouch HID: microsoft: Add quirk for MS Surface Type/Touch cover HID: wacom: NULL dereferences on error in probe()
-rw-r--r--drivers/hid/hid-cp2112.c2
-rw-r--r--drivers/hid/hid-multitouch.c7
-rw-r--r--drivers/hid/usbhid/hid-quirks.c3
-rw-r--r--drivers/hid/wacom_sys.c6
-rw-r--r--drivers/hid/wacom_wac.c3
5 files changed, 19 insertions, 2 deletions
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 3318de690e00..a2dbbbe0d8d7 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -356,6 +356,8 @@ static int cp2112_read(struct cp2112_device *dev, u8 *data, size_t size)
356 struct cp2112_force_read_report report; 356 struct cp2112_force_read_report report;
357 int ret; 357 int ret;
358 358
359 if (size > sizeof(dev->read_data))
360 size = sizeof(dev->read_data);
359 report.report = CP2112_DATA_READ_FORCE_SEND; 361 report.report = CP2112_DATA_READ_FORCE_SEND;
360 report.length = cpu_to_be16(size); 362 report.length = cpu_to_be16(size);
361 363
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6a9b05b328a9..7c811252c1ce 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -778,9 +778,16 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
778 /* 778 /*
779 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN" 779 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
780 * for the stylus. 780 * for the stylus.
781 * The check for mt_report_id ensures we don't process
782 * HID_DG_CONTACTCOUNT from the pen report as it is outside the physical
783 * collection, but within the report ID.
781 */ 784 */
782 if (field->physical == HID_DG_STYLUS) 785 if (field->physical == HID_DG_STYLUS)
783 return 0; 786 return 0;
787 else if ((field->physical == 0) &&
788 (field->report->id != td->mt_report_id) &&
789 (td->mt_report_id != -1))
790 return 0;
784 791
785 if (field->application == HID_DG_TOUCHSCREEN || 792 if (field->application == HID_DG_TOUCHSCREEN ||
786 field->application == HID_DG_TOUCHPAD) 793 field->application == HID_DG_TOUCHPAD)
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 53e7de7cb9e2..20f9a653444c 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -87,6 +87,9 @@ static const struct hid_blacklist {
87 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C05A, HID_QUIRK_ALWAYS_POLL }, 87 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C05A, HID_QUIRK_ALWAYS_POLL },
88 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C06A, HID_QUIRK_ALWAYS_POLL }, 88 { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C06A, HID_QUIRK_ALWAYS_POLL },
89 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, 89 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
90 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2, HID_QUIRK_NO_INIT_REPORTS },
91 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2, HID_QUIRK_NO_INIT_REPORTS },
92 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2, HID_QUIRK_NO_INIT_REPORTS },
90 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS }, 93 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS },
91 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP, HID_QUIRK_NO_INIT_REPORTS }, 94 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP, HID_QUIRK_NO_INIT_REPORTS },
92 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER, HID_QUIRK_NO_INIT_REPORTS }, 95 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER, HID_QUIRK_NO_INIT_REPORTS },
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 4c0ffca97bef..44958d79d598 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1271,11 +1271,13 @@ fail_leds:
1271 pad_input_dev = NULL; 1271 pad_input_dev = NULL;
1272 wacom_wac->pad_registered = false; 1272 wacom_wac->pad_registered = false;
1273fail_register_pad_input: 1273fail_register_pad_input:
1274 input_unregister_device(touch_input_dev); 1274 if (touch_input_dev)
1275 input_unregister_device(touch_input_dev);
1275 wacom_wac->touch_input = NULL; 1276 wacom_wac->touch_input = NULL;
1276 wacom_wac->touch_registered = false; 1277 wacom_wac->touch_registered = false;
1277fail_register_touch_input: 1278fail_register_touch_input:
1278 input_unregister_device(pen_input_dev); 1279 if (pen_input_dev)
1280 input_unregister_device(pen_input_dev);
1279 wacom_wac->pen_input = NULL; 1281 wacom_wac->pen_input = NULL;
1280 wacom_wac->pen_registered = false; 1282 wacom_wac->pen_registered = false;
1281fail_register_pen_input: 1283fail_register_pen_input:
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 232da89f4e88..0d244239e55d 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2213,6 +2213,9 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2213 features->x_max = 4096; 2213 features->x_max = 4096;
2214 features->y_max = 4096; 2214 features->y_max = 4096;
2215 } 2215 }
2216 else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
2217 features->device_type |= WACOM_DEVICETYPE_PAD;
2218 }
2216 } 2219 }
2217 2220
2218 /* 2221 /*