Skip to content

Commit 37c333a

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: - sysfs attributes leak fix for Google Vivaldi driver (Dmitry Torokhov) - fix for potential out-of-bounds read in Thrustmaster driver (Pavel Skripkin) - error handling reference leak in Elo driver (Jiri Kosina) - a few new device IDs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: nintendo: check the return value of alloc_workqueue() HID: vivaldi: fix sysfs attributes leak HID: hid-thrustmaster: fix OOB read in thrustmaster_interrupts HID: elo: Revert USB reference counting HID: Add support for open wheel and no attachment to T300 HID: logitech-dj: add new lightspeed receiver id
2 parents e7e19de + fe23b6b commit 37c333a

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

drivers/hid/hid-elo.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
228228
{
229229
struct elo_priv *priv;
230230
int ret;
231-
struct usb_device *udev;
232231

233232
if (!hid_is_usb(hdev))
234233
return -EINVAL;
@@ -238,8 +237,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
238237
return -ENOMEM;
239238

240239
INIT_DELAYED_WORK(&priv->work, elo_work);
241-
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
242-
priv->usbdev = usb_get_dev(udev);
240+
priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
243241

244242
hid_set_drvdata(hdev, priv);
245243

@@ -262,7 +260,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
262260

263261
return 0;
264262
err_free:
265-
usb_put_dev(udev);
266263
kfree(priv);
267264
return ret;
268265
}
@@ -271,8 +268,6 @@ static void elo_remove(struct hid_device *hdev)
271268
{
272269
struct elo_priv *priv = hid_get_drvdata(hdev);
273270

274-
usb_put_dev(priv->usbdev);
275-
276271
hid_hw_stop(hdev);
277272
cancel_delayed_work_sync(&priv->work);
278273
kfree(priv);

drivers/hid/hid-logitech-dj.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
10681068
workitem.reports_supported |= STD_KEYBOARD;
10691069
break;
10701070
case 0x0f:
1071+
case 0x11:
10711072
device_type = "eQUAD Lightspeed 1.2";
10721073
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
10731074
workitem.reports_supported |= STD_KEYBOARD;

drivers/hid/hid-nintendo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,10 @@ static int nintendo_hid_probe(struct hid_device *hdev,
21282128
spin_lock_init(&ctlr->lock);
21292129
ctlr->rumble_queue = alloc_workqueue("hid-nintendo-rumble_wq",
21302130
WQ_FREEZABLE | WQ_MEM_RECLAIM, 0);
2131+
if (!ctlr->rumble_queue) {
2132+
ret = -ENOMEM;
2133+
goto err;
2134+
}
21312135
INIT_WORK(&ctlr->rumble_worker, joycon_rumble_worker);
21322136

21332137
ret = hid_parse(hdev);

drivers/hid/hid-thrustmaster.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ struct tm_wheel_info {
6464
*/
6565
static const struct tm_wheel_info tm_wheels_infos[] = {
6666
{0x0306, 0x0006, "Thrustmaster T150RS"},
67+
{0x0200, 0x0005, "Thrustmaster T300RS (Missing Attachment)"},
6768
{0x0206, 0x0005, "Thrustmaster T300RS"},
69+
{0x0209, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"},
6870
{0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"},
6971
{0x0002, 0x0002, "Thrustmaster T500RS"}
7072
//{0x0407, 0x0001, "Thrustmaster TMX"}
@@ -158,6 +160,12 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
158160
return;
159161
}
160162

163+
if (usbif->cur_altsetting->desc.bNumEndpoints < 2) {
164+
kfree(send_buf);
165+
hid_err(hdev, "Wrong number of endpoints?\n");
166+
return;
167+
}
168+
161169
ep = &usbif->cur_altsetting->endpoint[1];
162170
b_ep = ep->desc.bEndpointAddress;
163171

drivers/hid/hid-vivaldi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev,
144144
static int vivaldi_input_configured(struct hid_device *hdev,
145145
struct hid_input *hidinput)
146146
{
147-
return sysfs_create_group(&hdev->dev.kobj, &input_attribute_group);
147+
return devm_device_add_group(&hdev->dev, &input_attribute_group);
148148
}
149149

150150
static const struct hid_device_id vivaldi_table[] = {

0 commit comments

Comments
 (0)