Skip to content

Commit d264dd3

Browse files
committed
Merge tag 'for-linus-2022122101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Benjamin Tissoires: - Four potential NULL pointers dereferences (Bastien Nocera, Enrik Berkhan, Jiasheng Jiang and Roderick Colenbrander) - Allow Wacom devices in bootloader mode to be flashed (Jason Gerecke) - Some assorted devices quirks (José Expósito and Terry Junge) * tag 'for-linus-2022122101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: sony: Fix unused function warning HID: plantronics: Additional PIDs for double volume key presses quirk HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint HID: Ignore HP Envy x360 eu0009nv stylus battery HID: wacom: Ensure bootloader PID is usable in hidraw mode HID: amd_sfh: Add missing check for dma_alloc_coherent HID: playstation: fix free of uninialized pointer for DS4 in Bluetooth. HID: mcp2221: don't connect hidraw HID: logitech-hidpp: Guard FF init code against non-USB devices
2 parents 5461e07 + 54f27dc commit d264dd3

File tree

13 files changed

+58
-7
lines changed

13 files changed

+58
-7
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ config HID_PLAYSTATION
897897
select CRC32
898898
select POWER_SUPPLY
899899
help
900-
Provides support for Sony PS5 controllers including support for
900+
Provides support for Sony PS4/PS5 controllers including support for
901901
its special functionalities e.g. touchpad, lights and motion
902902
sensors.
903903

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
237237
in_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
238238
&cl_data->sensor_dma_addr[i],
239239
GFP_KERNEL);
240+
if (!in_data->sensor_virt_addr[i]) {
241+
rc = -ENOMEM;
242+
goto cleanup;
243+
}
240244
cl_data->sensor_sts[i] = SENSOR_DISABLED;
241245
cl_data->sensor_requested_cnt[i] = 0;
242246
cl_data->cur_hid_dev = i;

drivers/hid/hid-ids.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@
412412
#define USB_DEVICE_ID_HP_X2_10_COVER 0x0755
413413
#define I2C_DEVICE_ID_HP_ENVY_X360_15 0x2d05
414414
#define I2C_DEVICE_ID_HP_ENVY_X360_15T_DR100 0x29CF
415+
#define I2C_DEVICE_ID_HP_ENVY_X360_EU0009NV 0x2CF9
415416
#define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817
416417
#define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544
417418
#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706
@@ -995,7 +996,10 @@
995996
#define USB_DEVICE_ID_ORTEK_IHOME_IMAC_A210S 0x8003
996997

997998
#define USB_VENDOR_ID_PLANTRONICS 0x047f
999+
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3210_SERIES 0xc055
9981000
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES 0xc056
1001+
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES 0xc057
1002+
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES 0xc058
9991003

10001004
#define USB_VENDOR_ID_PANASONIC 0x04da
10011005
#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044

drivers/hid/hid-input.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ static const struct hid_device_id hid_battery_quirks[] = {
380380
HID_BATTERY_QUIRK_IGNORE },
381381
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_15T_DR100),
382382
HID_BATTERY_QUIRK_IGNORE },
383+
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_EU0009NV),
384+
HID_BATTERY_QUIRK_IGNORE },
383385
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_15),
384386
HID_BATTERY_QUIRK_IGNORE },
385387
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN),

drivers/hid/hid-logitech-hidpp.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,12 +2548,17 @@ static int hidpp_ff_init(struct hidpp_device *hidpp,
25482548
struct hid_device *hid = hidpp->hid_dev;
25492549
struct hid_input *hidinput;
25502550
struct input_dev *dev;
2551-
const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor);
2552-
const u16 bcdDevice = le16_to_cpu(udesc->bcdDevice);
2551+
struct usb_device_descriptor *udesc;
2552+
u16 bcdDevice;
25532553
struct ff_device *ff;
25542554
int error, j, num_slots = data->num_effects;
25552555
u8 version;
25562556

2557+
if (!hid_is_usb(hid)) {
2558+
hid_err(hid, "device is not USB\n");
2559+
return -ENODEV;
2560+
}
2561+
25572562
if (list_empty(&hid->inputs)) {
25582563
hid_err(hid, "no inputs found\n");
25592564
return -ENODEV;
@@ -2567,6 +2572,8 @@ static int hidpp_ff_init(struct hidpp_device *hidpp,
25672572
}
25682573

25692574
/* Get firmware release */
2575+
udesc = &(hid_to_usb_dev(hid)->descriptor);
2576+
bcdDevice = le16_to_cpu(udesc->bcdDevice);
25702577
version = bcdDevice & 255;
25712578

25722579
/* Set supported force feedback capabilities */

drivers/hid/hid-mcp2221.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,12 +1110,19 @@ static int mcp2221_probe(struct hid_device *hdev,
11101110
return ret;
11111111
}
11121112

1113-
ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
1113+
/*
1114+
* This driver uses the .raw_event callback and therefore does not need any
1115+
* HID_CONNECT_xxx flags.
1116+
*/
1117+
ret = hid_hw_start(hdev, 0);
11141118
if (ret) {
11151119
hid_err(hdev, "can't start hardware\n");
11161120
return ret;
11171121
}
11181122

1123+
hid_info(hdev, "USB HID v%x.%02x Device [%s] on %s\n", hdev->version >> 8,
1124+
hdev->version & 0xff, hdev->name, hdev->phys);
1125+
11191126
ret = hid_hw_open(hdev);
11201127
if (ret) {
11211128
hid_err(hdev, "can't open device\n");
@@ -1145,8 +1152,7 @@ static int mcp2221_probe(struct hid_device *hdev,
11451152
mcp->adapter.retries = 1;
11461153
mcp->adapter.dev.parent = &hdev->dev;
11471154
snprintf(mcp->adapter.name, sizeof(mcp->adapter.name),
1148-
"MCP2221 usb-i2c bridge on hidraw%d",
1149-
((struct hidraw *)hdev->hidraw)->minor);
1155+
"MCP2221 usb-i2c bridge");
11501156

11511157
ret = devm_i2c_add_adapter(&hdev->dev, &mcp->adapter);
11521158
if (ret) {

drivers/hid/hid-multitouch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,6 +1967,10 @@ static const struct hid_device_id mt_devices[] = {
19671967
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
19681968
USB_VENDOR_ID_ELAN, 0x313a) },
19691969

1970+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
1971+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
1972+
USB_VENDOR_ID_ELAN, 0x3148) },
1973+
19701974
/* Elitegroup panel */
19711975
{ .driver_data = MT_CLS_SERIAL,
19721976
MT_USB_DEVICE(USB_VENDOR_ID_ELITEGROUP,

drivers/hid/hid-plantronics.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,18 @@ static int plantronics_probe(struct hid_device *hdev,
198198
}
199199

200200
static const struct hid_device_id plantronics_devices[] = {
201+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
202+
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3210_SERIES),
203+
.driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
201204
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
202205
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES),
203206
.driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
207+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
208+
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES),
209+
.driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
210+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
211+
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES),
212+
.driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
204213
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
205214
{ }
206215
};

drivers/hid/hid-playstation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ static int dualshock4_get_mac_address(struct dualshock4 *ds4)
19161916
if (ret != sizeof(ds4->base.mac_address))
19171917
return -EINVAL;
19181918

1919-
ret = 0;
1919+
return 0;
19201920
}
19211921

19221922
err_free:

drivers/hid/hid-sony.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,11 +2355,13 @@ static void motion_send_output_report(struct sony_sc *sc)
23552355
hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE);
23562356
}
23572357

2358+
#ifdef CONFIG_SONY_FF
23582359
static inline void sony_send_output_report(struct sony_sc *sc)
23592360
{
23602361
if (sc->send_output_report)
23612362
sc->send_output_report(sc);
23622363
}
2364+
#endif
23632365

23642366
static void sony_state_worker(struct work_struct *work)
23652367
{

0 commit comments

Comments
 (0)