Commit e69ec487 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID fixes from Jiri Kosina:

 - fix for OOB in hiddev, from Dmitry Torokhov

 - _poll API fixes for hidraw, from Marcel Holtmann

 - functional fix for Steam driver, from Rodrigo Rivas Costa

 - a few new device IDs / device-specific quirks and other assorted
   smaller fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  HID: steam: Fix input device disappearing
  HID: intel-ish-hid: ipc: Add Tiger Lake PCI device ID
  drivers/hid/hid-multitouch.c: fix a possible null pointer access.
  HID: wacom: Recognize new MobileStudio Pro PID
  HID: intel-ish-hid: ipc: add CMP device id
  HID: hiddev: fix mess in hiddev_open()
  HID: hid-input: clear unmapped usages
  HID: Add quirk for incorrect input length on Lenovo Y720
  HID: asus: Ignore Asus vendor-page usage-code 0xff events
  HID: ite: Add USB id match for Acer SW5-012 keyboard dock
  HID: Add quirk for Xin-Mo Dual Controller
  HID: Fix slab-out-of-bounds read in hid_field_extract
  HID: multitouch: Add LG MELF0410 I2C touchscreen support
  HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
  HID: hidraw: Fix returning EPOLLOUT from hidraw_poll
parents a5f48c78 20eee6e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -261,7 +261,8 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field,
		      struct hid_usage *usage, __s32 value)
{
	if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 &&
	    (usage->hid & HID_USAGE) != 0x00 && !usage->type) {
	    (usage->hid & HID_USAGE) != 0x00 &&
	    (usage->hid & HID_USAGE) != 0xff && !usage->type) {
		hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n",
			 usage->hid & HID_USAGE);
	}
+6 −0
Original line number Diff line number Diff line
@@ -288,6 +288,12 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
	offset = report->size;
	report->size += parser->global.report_size * parser->global.report_count;

	/* Total size check: Allow for possible report index byte */
	if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) {
		hid_err(parser->device, "report is too long\n");
		return -1;
	}

	if (!parser->local.usage_index) /* Ignore padding fields */
		return 0;

+3 −0
Original line number Diff line number Diff line
@@ -631,6 +631,7 @@
#define USB_VENDOR_ID_ITE               0x048d
#define USB_DEVICE_ID_ITE_LENOVO_YOGA   0x8386
#define USB_DEVICE_ID_ITE_LENOVO_YOGA2  0x8350
#define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720	0x837a
#define USB_DEVICE_ID_ITE_LENOVO_YOGA900	0x8396
#define USB_DEVICE_ID_ITE8595		0x8595

@@ -730,6 +731,7 @@
#define USB_DEVICE_ID_LG_MULTITOUCH	0x0064
#define USB_DEVICE_ID_LG_MELFAS_MT	0x6007
#define I2C_DEVICE_ID_LG_8001		0x8001
#define I2C_DEVICE_ID_LG_7010		0x7010

#define USB_VENDOR_ID_LOGITECH		0x046d
#define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e
@@ -1102,6 +1104,7 @@
#define USB_DEVICE_ID_SYNAPTICS_LTS2	0x1d10
#define USB_DEVICE_ID_SYNAPTICS_HD	0x0ac3
#define USB_DEVICE_ID_SYNAPTICS_QUAD_HD	0x1ac3
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012	0x2968
#define USB_DEVICE_ID_SYNAPTICS_TP_V103	0x5710
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5	0x81a7

+12 −4
Original line number Diff line number Diff line
@@ -1132,9 +1132,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
	}

mapped:
	if (device->driver->input_mapped && device->driver->input_mapped(device,
				hidinput, field, usage, &bit, &max) < 0)
		goto ignore;
	if (device->driver->input_mapped &&
	    device->driver->input_mapped(device, hidinput, field, usage,
					 &bit, &max) < 0) {
		/*
		 * The driver indicated that no further generic handling
		 * of the usage is desired.
		 */
		return;
	}

	set_bit(usage->type, input->evbit);

@@ -1215,9 +1221,11 @@ mapped:
		set_bit(MSC_SCAN, input->mscbit);
	}

ignore:
	return;

ignore:
	usage->type = 0;
	usage->code = 0;
}

static void hidinput_handle_scroll(struct hid_usage *usage,
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ static int ite_event(struct hid_device *hdev, struct hid_field *field,
static const struct hid_device_id ite_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_258A, USB_DEVICE_ID_258A_6A88) },
	/* ITE8595 USB kbd ctlr, with Synaptics touchpad connected to it. */
	{ HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS,
			 USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
	{ }
};
MODULE_DEVICE_TABLE(hid, ite_devices);
Loading