Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Jul 20, 2017
2 parents beaec53 + 929b60a commit c6efb45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hid-logitech-hidpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
hidpp_battery_props,
sizeof(hidpp_battery_props),
GFP_KERNEL);
if (!battery_props)
return -ENOMEM;

num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2;

if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE)
Expand Down
16 changes: 4 additions & 12 deletions drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,16 +620,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
}

static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
if (usage->type == EV_KEY || usage->type == EV_ABS)
set_bit(usage->type, hi->input->evbit);

return -1;
}

static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
{
__s32 quirks = td->mtclass.quirks;
Expand Down Expand Up @@ -969,8 +959,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
return 0;

if (field->application == HID_DG_TOUCHSCREEN ||
field->application == HID_DG_TOUCHPAD)
return mt_touch_input_mapped(hdev, hi, field, usage, bit, max);
field->application == HID_DG_TOUCHPAD) {
/* We own these mappings, tell hid-input to ignore them */
return -1;
}

/* let hid-core decide for the others */
return 0;
Expand Down

0 comments on commit c6efb45

Please sign in to comment.