aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-20 13:14:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-20 13:14:54 -0400
commitc6efb4548d0a665b791b3db0de7accd63d630f1d (patch)
tree50aaa2c8ead4d7a4e04d9b6d4b3c5738d11b5df3
parentbeaec533fc2701a28a4d667f67c9f59c6e4e0d13 (diff)
parent929b60a85b731d803f2b7829149496479eba0b20 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fixes from Jiri Kosina: - HID multitouch 4.12 regression fix from Dmitry Torokhov - error handling fix for HID++ driver from Gustavo A. R. Silva * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: hid-logitech-hidpp: add NULL check on devm_kmemdup() return value HID: multitouch: do not blindly set EV_KEY or EV_ABS bits
-rw-r--r--drivers/hid/hid-logitech-hidpp.c3
-rw-r--r--drivers/hid/hid-multitouch.c16
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 41b39464ded8..501e16a9227d 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
2732 hidpp_battery_props, 2732 hidpp_battery_props,
2733 sizeof(hidpp_battery_props), 2733 sizeof(hidpp_battery_props),
2734 GFP_KERNEL); 2734 GFP_KERNEL);
2735 if (!battery_props)
2736 return -ENOMEM;
2737
2735 num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2; 2738 num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2;
2736 2739
2737 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE) 2740 if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f3e35e7a189d..aff20f4b6d97 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -620,16 +620,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
620 return 0; 620 return 0;
621} 621}
622 622
623static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
624 struct hid_field *field, struct hid_usage *usage,
625 unsigned long **bit, int *max)
626{
627 if (usage->type == EV_KEY || usage->type == EV_ABS)
628 set_bit(usage->type, hi->input->evbit);
629
630 return -1;
631}
632
633static int mt_compute_slot(struct mt_device *td, struct input_dev *input) 623static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
634{ 624{
635 __s32 quirks = td->mtclass.quirks; 625 __s32 quirks = td->mtclass.quirks;
@@ -969,8 +959,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
969 return 0; 959 return 0;
970 960
971 if (field->application == HID_DG_TOUCHSCREEN || 961 if (field->application == HID_DG_TOUCHSCREEN ||
972 field->application == HID_DG_TOUCHPAD) 962 field->application == HID_DG_TOUCHPAD) {
973 return mt_touch_input_mapped(hdev, hi, field, usage, bit, max); 963 /* We own these mappings, tell hid-input to ignore them */
964 return -1;
965 }
974 966
975 /* let hid-core decide for the others */ 967 /* let hid-core decide for the others */
976 return 0; 968 return 0;