Commit 37c333a5 authored by Linus Torvalds's avatar Linus Torvalds

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
parents e7e19def fe23b6bb
...@@ -228,7 +228,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -228,7 +228,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
struct elo_priv *priv; struct elo_priv *priv;
int ret; int ret;
struct usb_device *udev;
if (!hid_is_usb(hdev)) if (!hid_is_usb(hdev))
return -EINVAL; return -EINVAL;
...@@ -238,8 +237,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -238,8 +237,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
return -ENOMEM; return -ENOMEM;
INIT_DELAYED_WORK(&priv->work, elo_work); INIT_DELAYED_WORK(&priv->work, elo_work);
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent)); priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
priv->usbdev = usb_get_dev(udev);
hid_set_drvdata(hdev, priv); hid_set_drvdata(hdev, priv);
...@@ -262,7 +260,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -262,7 +260,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
return 0; return 0;
err_free: err_free:
usb_put_dev(udev);
kfree(priv); kfree(priv);
return ret; return ret;
} }
...@@ -271,8 +268,6 @@ static void elo_remove(struct hid_device *hdev) ...@@ -271,8 +268,6 @@ static void elo_remove(struct hid_device *hdev)
{ {
struct elo_priv *priv = hid_get_drvdata(hdev); struct elo_priv *priv = hid_get_drvdata(hdev);
usb_put_dev(priv->usbdev);
hid_hw_stop(hdev); hid_hw_stop(hdev);
cancel_delayed_work_sync(&priv->work); cancel_delayed_work_sync(&priv->work);
kfree(priv); kfree(priv);
......
...@@ -1068,6 +1068,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, ...@@ -1068,6 +1068,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
workitem.reports_supported |= STD_KEYBOARD; workitem.reports_supported |= STD_KEYBOARD;
break; break;
case 0x0f: case 0x0f:
case 0x11:
device_type = "eQUAD Lightspeed 1.2"; device_type = "eQUAD Lightspeed 1.2";
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
workitem.reports_supported |= STD_KEYBOARD; workitem.reports_supported |= STD_KEYBOARD;
......
...@@ -2128,6 +2128,10 @@ static int nintendo_hid_probe(struct hid_device *hdev, ...@@ -2128,6 +2128,10 @@ static int nintendo_hid_probe(struct hid_device *hdev,
spin_lock_init(&ctlr->lock); spin_lock_init(&ctlr->lock);
ctlr->rumble_queue = alloc_workqueue("hid-nintendo-rumble_wq", ctlr->rumble_queue = alloc_workqueue("hid-nintendo-rumble_wq",
WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); WQ_FREEZABLE | WQ_MEM_RECLAIM, 0);
if (!ctlr->rumble_queue) {
ret = -ENOMEM;
goto err;
}
INIT_WORK(&ctlr->rumble_worker, joycon_rumble_worker); INIT_WORK(&ctlr->rumble_worker, joycon_rumble_worker);
ret = hid_parse(hdev); ret = hid_parse(hdev);
......
...@@ -64,7 +64,9 @@ struct tm_wheel_info { ...@@ -64,7 +64,9 @@ struct tm_wheel_info {
*/ */
static const struct tm_wheel_info tm_wheels_infos[] = { static const struct tm_wheel_info tm_wheels_infos[] = {
{0x0306, 0x0006, "Thrustmaster T150RS"}, {0x0306, 0x0006, "Thrustmaster T150RS"},
{0x0200, 0x0005, "Thrustmaster T300RS (Missing Attachment)"},
{0x0206, 0x0005, "Thrustmaster T300RS"}, {0x0206, 0x0005, "Thrustmaster T300RS"},
{0x0209, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"},
{0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"}, {0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"},
{0x0002, 0x0002, "Thrustmaster T500RS"} {0x0002, 0x0002, "Thrustmaster T500RS"}
//{0x0407, 0x0001, "Thrustmaster TMX"} //{0x0407, 0x0001, "Thrustmaster TMX"}
...@@ -158,6 +160,12 @@ static void thrustmaster_interrupts(struct hid_device *hdev) ...@@ -158,6 +160,12 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
return; return;
} }
if (usbif->cur_altsetting->desc.bNumEndpoints < 2) {
kfree(send_buf);
hid_err(hdev, "Wrong number of endpoints?\n");
return;
}
ep = &usbif->cur_altsetting->endpoint[1]; ep = &usbif->cur_altsetting->endpoint[1];
b_ep = ep->desc.bEndpointAddress; b_ep = ep->desc.bEndpointAddress;
......
...@@ -144,7 +144,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev, ...@@ -144,7 +144,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev,
static int vivaldi_input_configured(struct hid_device *hdev, static int vivaldi_input_configured(struct hid_device *hdev,
struct hid_input *hidinput) struct hid_input *hidinput)
{ {
return sysfs_create_group(&hdev->dev.kobj, &input_attribute_group); return devm_device_add_group(&hdev->dev, &input_attribute_group);
} }
static const struct hid_device_id vivaldi_table[] = { static const struct hid_device_id vivaldi_table[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment