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

 - memory leak fix in usbhid from Anirudh Rayabharam

 - additions for a few new recognized generic key IDs from Dmitry
   Torokhov

 - Asus T101HA and Dell K15A quirks from Hans de Goede

 - memory leak fix in amd_sfh from Basavaraj Natikar

 - Win8 compatibility and Stylus fixes in multitouch driver from
   Ahelenia Ziemiańska

 - NULL pointer dereference fix in hid-magicmouse from Johan Hovold

 - assorted other small fixes and device ID additions

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (33 commits)
  HID: asus: Cleanup Asus T101HA keyboard-dock handling
  HID: magicmouse: fix NULL-deref on disconnect
  HID: intel-ish-hid: ipc: Add Alder Lake device IDs
  HID: i2c-hid: fix format string mismatch
  HID: amd_sfh: Fix memory leak in amd_sfh_work
  HID: amd_sfh: Use devm_kzalloc() instead of kzalloc()
  HID: ft260: improve error handling of ft260_hid_feature_report_get()
  HID: magicmouse: fix crash when disconnecting Magic Trackpad 2
  HID: gt683r: add missing MODULE_DEVICE_TABLE
  HID: pidff: fix error return code in hid_pidff_init()
  HID: logitech-hidpp: initialize level variable
  HID: multitouch: Disable event reporting on suspend on the Asus T101HA touchpad
  HID: core: Remove extraneous empty line before EXPORT_SYMBOL_GPL(hid_check_keys_pressed)
  HID: hid-sensor-custom: Process failure of sensor_hub_set_feature()
  HID: i2c-hid: Skip ELAN power-on command after reset
  HID: usbhid: fix info leak in hid_submit_ctrl
  HID: Add BUS_VIRTUAL to hid_connect logging
  HID: multitouch: set Stylus suffix for Stylus-application devices, too
  HID: multitouch: require Finger field to mark Win8 reports as MT
  HID: remove the unnecessary redefinition of a macro
  ...
parents 00151f51 a94f66ae
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -93,11 +93,11 @@ menu "Special HID drivers"
	depends on HID

config HID_A4TECH
	tristate "A4 tech mice"
	tristate "A4TECH mice"
	depends on HID
	default !EXPERT
	help
	Support for A4 tech X5 and WOP-35 / Trust 450L mice.
	Support for some A4TECH mice with two scroll wheels.

config HID_ACCUTOUCH
	tristate "Accutouch touch device"
@@ -922,6 +922,21 @@ config HID_SAMSUNG
	help
	Support for Samsung InfraRed remote control or keyboards.

config HID_SEMITEK
	tristate "Semitek USB keyboards"
	depends on HID
	help
	Support for Semitek USB keyboards that are not fully compliant
	with the HID standard.

	There are many variants, including:
	- GK61, GK64, GK68, GK84, GK96, etc.
	- SK61, SK64, SK68, SK84, SK96, etc.
	- Dierya DK61/DK66
	- Tronsmart TK09R
	- Woo-dy
	- X-Bows Nature/Knight

config HID_SONY
	tristate "Sony PS2/3/4 accessories"
	depends on USB_HID
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
obj-$(CONFIG_HID_RMI)		+= hid-rmi.o
obj-$(CONFIG_HID_SAITEK)	+= hid-saitek.o
obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
obj-$(CONFIG_HID_SEMITEK)	+= hid-semitek.o
obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
obj-$(CONFIG_HID_SONY)		+= hid-sony.o
obj-$(CONFIG_HID_SPEEDLINK)	+= hid-speedlink.o
+10 −9
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ static void amd_sfh_work(struct work_struct *work)
	sensor_index = req_node->sensor_idx;
	report_id = req_node->report_id;
	node_type = req_node->report_type;
	kfree(req_node);

	if (node_type == HID_FEATURE_REPORT) {
		report_size = get_feature_report(sensor_index, report_id,
@@ -142,7 +143,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
	int rc, i;

	dev = &privdata->pdev->dev;
	cl_data = kzalloc(sizeof(*cl_data), GFP_KERNEL);
	cl_data = devm_kzalloc(dev, sizeof(*cl_data), GFP_KERNEL);
	if (!cl_data)
		return -ENOMEM;

@@ -175,12 +176,12 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
			rc = -EINVAL;
			goto cleanup;
		}
		cl_data->feature_report[i] = kzalloc(feature_report_size, GFP_KERNEL);
		cl_data->feature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL);
		if (!cl_data->feature_report[i]) {
			rc = -ENOMEM;
			goto cleanup;
		}
		cl_data->input_report[i] = kzalloc(input_report_size, GFP_KERNEL);
		cl_data->input_report[i] = devm_kzalloc(dev, input_report_size, GFP_KERNEL);
		if (!cl_data->input_report[i]) {
			rc = -ENOMEM;
			goto cleanup;
@@ -189,7 +190,8 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
		info.sensor_idx = cl_idx;
		info.dma_address = cl_data->sensor_dma_addr[i];

		cl_data->report_descr[i] = kzalloc(cl_data->report_descr_sz[i], GFP_KERNEL);
		cl_data->report_descr[i] =
			devm_kzalloc(dev, cl_data->report_descr_sz[i], GFP_KERNEL);
		if (!cl_data->report_descr[i]) {
			rc = -ENOMEM;
			goto cleanup;
@@ -214,11 +216,11 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
					  cl_data->sensor_virt_addr[i],
					  cl_data->sensor_dma_addr[i]);
		}
		kfree(cl_data->feature_report[i]);
		kfree(cl_data->input_report[i]);
		kfree(cl_data->report_descr[i]);
		devm_kfree(dev, cl_data->feature_report[i]);
		devm_kfree(dev, cl_data->input_report[i]);
		devm_kfree(dev, cl_data->report_descr[i]);
	}
	kfree(cl_data);
	devm_kfree(dev, cl_data);
	return rc;
}

@@ -241,6 +243,5 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
					  cl_data->sensor_dma_addr[i]);
		}
	}
	kfree(cl_data);
	return 0;
}
+0 −3
Original line number Diff line number Diff line
@@ -162,9 +162,6 @@ void amdtp_hid_remove(struct amdtp_cl_data *cli_data)
	int i;

	for (i = 0; i < cli_data->num_hid_devices; ++i) {
		kfree(cli_data->feature_report[i]);
		kfree(cli_data->input_report[i]);
		kfree(cli_data->report_descr[i]);
		if (cli_data->hid_sensor_hubs[i]) {
			kfree(cli_data->hid_sensor_hubs[i]->driver_data);
			hid_destroy_device(cli_data->hid_sensor_hubs[i]);
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@ static const struct hid_device_id a4_devices[] = {
		.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649),
		.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_NB_95),
		.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
	{ }
};
MODULE_DEVICE_TABLE(hid, a4_devices);
Loading