Skip to content

Commit 763cf1f

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - fix for one corner case in HID++ protocol with respect to handling very long reports, from Hans de Goede - power management fix in Intel-ISH driver, from Hyungwoo Yang - use-after-free fix in Intel-ISH driver, from Dan Carpenter - a couple of new device IDs/quirks from Kai-Heng Feng, Kyle Godbey and Oleksandr Natalenko * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: intel-ish-hid: fix wrong driver_data usage HID: multitouch: Add pointstick support for ALPS Touchpad HID: logitech-dj: Fix forwarding of very long HID++ reports HID: uclogic: Add support for Huion HS64 tablet HID: chicony: add another quirk for PixArt mouse HID: intel-ish-hid: Fix a use after free in load_fw_from_host()
2 parents fe2da89 + b12bbdc commit 763cf1f

File tree

10 files changed

+33
-5
lines changed

10 files changed

+33
-5
lines changed

drivers/hid/hid-ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP 0x1220
8181
#define HID_DEVICE_ID_ALPS_U1 0x1215
8282
#define HID_DEVICE_ID_ALPS_T4_BTNLESS 0x120C
83+
#define HID_DEVICE_ID_ALPS_1222 0x1222
8384

8485

8586
#define USB_VENDOR_ID_AMI 0x046b
@@ -269,6 +270,7 @@
269270
#define USB_DEVICE_ID_CHICONY_MULTI_TOUCH 0xb19d
270271
#define USB_DEVICE_ID_CHICONY_WIRELESS 0x0618
271272
#define USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE 0x1053
273+
#define USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2 0x0939
272274
#define USB_DEVICE_ID_CHICONY_WIRELESS2 0x1123
273275
#define USB_DEVICE_ID_ASUS_AK1D 0x1125
274276
#define USB_DEVICE_ID_CHICONY_TOSHIBA_WT10A 0x1408
@@ -569,6 +571,7 @@
569571

570572
#define USB_VENDOR_ID_HUION 0x256c
571573
#define USB_DEVICE_ID_HUION_TABLET 0x006e
574+
#define USB_DEVICE_ID_HUION_HS64 0x006d
572575

573576
#define USB_VENDOR_ID_IBM 0x04b3
574577
#define USB_DEVICE_ID_IBM_SCROLLPOINT_III 0x3100

drivers/hid/hid-logitech-dj.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#define REPORT_ID_HIDPP_SHORT 0x10
3232
#define REPORT_ID_HIDPP_LONG 0x11
33+
#define REPORT_ID_HIDPP_VERY_LONG 0x12
3334

3435
#define HIDPP_REPORT_SHORT_LENGTH 7
3536
#define HIDPP_REPORT_LONG_LENGTH 20
@@ -1242,7 +1243,8 @@ static int logi_dj_ll_raw_request(struct hid_device *hid,
12421243
int ret;
12431244

12441245
if ((buf[0] == REPORT_ID_HIDPP_SHORT) ||
1245-
(buf[0] == REPORT_ID_HIDPP_LONG)) {
1246+
(buf[0] == REPORT_ID_HIDPP_LONG) ||
1247+
(buf[0] == REPORT_ID_HIDPP_VERY_LONG)) {
12461248
if (count < 2)
12471249
return -EINVAL;
12481250

drivers/hid/hid-multitouch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,10 @@ static const struct hid_device_id mt_devices[] = {
17761776
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
17771777
USB_VENDOR_ID_ALPS_JP,
17781778
HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP) },
1779+
{ .driver_data = MT_CLS_WIN_8_DUAL,
1780+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
1781+
USB_VENDOR_ID_ALPS_JP,
1782+
HID_DEVICE_ID_ALPS_1222) },
17791783

17801784
/* Lenovo X1 TAB Gen 2 */
17811785
{ .driver_data = MT_CLS_WIN_8_DUAL,

drivers/hid/hid-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const struct hid_device_id hid_quirks[] = {
4242
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM), HID_QUIRK_NOGET },
4343
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
4444
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
45+
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
4546
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS), HID_QUIRK_MULTI_INPUT },
4647
{ HID_USB_DEVICE(USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD), HID_QUIRK_BADPAD },
4748
{ HID_USB_DEVICE(USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK), HID_QUIRK_NOGET },

drivers/hid/hid-uclogic-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ static const struct hid_device_id uclogic_devices[] = {
369369
USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) },
370370
{ HID_USB_DEVICE(USB_VENDOR_ID_HUION,
371371
USB_DEVICE_ID_HUION_TABLET) },
372+
{ HID_USB_DEVICE(USB_VENDOR_ID_HUION,
373+
USB_DEVICE_ID_HUION_HS64) },
372374
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
373375
USB_DEVICE_ID_HUION_TABLET) },
374376
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,

drivers/hid/hid-uclogic-params.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ int uclogic_params_init(struct uclogic_params *params,
977977
/* FALL THROUGH */
978978
case VID_PID(USB_VENDOR_ID_HUION,
979979
USB_DEVICE_ID_HUION_TABLET):
980+
case VID_PID(USB_VENDOR_ID_HUION,
981+
USB_DEVICE_ID_HUION_HS64):
980982
case VID_PID(USB_VENDOR_ID_UCLOGIC,
981983
USB_DEVICE_ID_HUION_TABLET):
982984
case VID_PID(USB_VENDOR_ID_UCLOGIC,

drivers/hid/intel-ish-hid/ishtp-fw-loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,9 @@ static int load_fw_from_host(struct ishtp_cl_data *client_data)
816816
goto end_err_fw_release;
817817

818818
release_firmware(fw);
819-
kfree(filename);
820819
dev_info(cl_data_to_dev(client_data), "ISH firmware %s loaded\n",
821820
filename);
821+
kfree(filename);
822822
return 0;
823823

824824
end_err_fw_release:

drivers/hid/intel-ish-hid/ishtp-hid-client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static int hid_ishtp_cl_reset(struct ishtp_cl_device *cl_device)
891891
*/
892892
static int hid_ishtp_cl_suspend(struct device *device)
893893
{
894-
struct ishtp_cl_device *cl_device = dev_get_drvdata(device);
894+
struct ishtp_cl_device *cl_device = ishtp_dev_to_cl_device(device);
895895
struct ishtp_cl *hid_ishtp_cl = ishtp_get_drvdata(cl_device);
896896
struct ishtp_cl_data *client_data = ishtp_get_client_data(hid_ishtp_cl);
897897

@@ -912,7 +912,7 @@ static int hid_ishtp_cl_suspend(struct device *device)
912912
*/
913913
static int hid_ishtp_cl_resume(struct device *device)
914914
{
915-
struct ishtp_cl_device *cl_device = dev_get_drvdata(device);
915+
struct ishtp_cl_device *cl_device = ishtp_dev_to_cl_device(device);
916916
struct ishtp_cl *hid_ishtp_cl = ishtp_get_drvdata(cl_device);
917917
struct ishtp_cl_data *client_data = ishtp_get_client_data(hid_ishtp_cl);
918918

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
471471
}
472472

473473
ishtp_device_ready = true;
474-
dev_set_drvdata(&device->dev, device);
475474

476475
return device;
477476
}
@@ -639,6 +638,20 @@ void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device)
639638
}
640639
EXPORT_SYMBOL(ishtp_get_drvdata);
641640

641+
/**
642+
* ishtp_dev_to_cl_device() - get ishtp_cl_device instance from device instance
643+
* @device: device instance
644+
*
645+
* Get ish_cl_device instance which embeds device instance in it.
646+
*
647+
* Return: pointer to ishtp_cl_device instance
648+
*/
649+
struct ishtp_cl_device *ishtp_dev_to_cl_device(struct device *device)
650+
{
651+
return to_ishtp_cl_device(device);
652+
}
653+
EXPORT_SYMBOL(ishtp_dev_to_cl_device);
654+
642655
/**
643656
* ishtp_bus_new_client() - Create a new client
644657
* @dev: ISHTP device instance

include/linux/intel-ish-client-if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void ishtp_put_device(struct ishtp_cl_device *cl_dev);
103103
void ishtp_get_device(struct ishtp_cl_device *cl_dev);
104104
void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
105105
void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
106+
struct ishtp_cl_device *ishtp_dev_to_cl_device(struct device *dev);
106107
int ishtp_register_event_cb(struct ishtp_cl_device *device,
107108
void (*read_cb)(struct ishtp_cl_device *));
108109
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,

0 commit comments

Comments
 (0)