Skip to content

Commit c6efb45

Browse files
committed
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
2 parents beaec53 + 929b60a commit c6efb45

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
27322732
hidpp_battery_props,
27332733
sizeof(hidpp_battery_props),
27342734
GFP_KERNEL);
2735+
if (!battery_props)
2736+
return -ENOMEM;
2737+
27352738
num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2;
27362739

27372740
if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE)

drivers/hid/hid-multitouch.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -620,16 +620,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
620620
return 0;
621621
}
622622

623-
static 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-
633623
static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
634624
{
635625
__s32 quirks = td->mtclass.quirks;
@@ -969,8 +959,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
969959
return 0;
970960

971961
if (field->application == HID_DG_TOUCHSCREEN ||
972-
field->application == HID_DG_TOUCHPAD)
973-
return mt_touch_input_mapped(hdev, hi, field, usage, bit, max);
962+
field->application == HID_DG_TOUCHPAD) {
963+
/* We own these mappings, tell hid-input to ignore them */
964+
return -1;
965+
}
974966

975967
/* let hid-core decide for the others */
976968
return 0;

0 commit comments

Comments
 (0)