mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
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
This commit is contained in:
commit
37c333a5de
@ -228,7 +228,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
{
|
||||
struct elo_priv *priv;
|
||||
int ret;
|
||||
struct usb_device *udev;
|
||||
|
||||
if (!hid_is_usb(hdev))
|
||||
return -EINVAL;
|
||||
@ -238,8 +237,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
return -ENOMEM;
|
||||
|
||||
INIT_DELAYED_WORK(&priv->work, elo_work);
|
||||
udev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
|
||||
priv->usbdev = usb_get_dev(udev);
|
||||
priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));
|
||||
|
||||
hid_set_drvdata(hdev, priv);
|
||||
|
||||
@ -262,7 +260,6 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
|
||||
return 0;
|
||||
err_free:
|
||||
usb_put_dev(udev);
|
||||
kfree(priv);
|
||||
return ret;
|
||||
}
|
||||
@ -271,8 +268,6 @@ static void elo_remove(struct hid_device *hdev)
|
||||
{
|
||||
struct elo_priv *priv = hid_get_drvdata(hdev);
|
||||
|
||||
usb_put_dev(priv->usbdev);
|
||||
|
||||
hid_hw_stop(hdev);
|
||||
cancel_delayed_work_sync(&priv->work);
|
||||
kfree(priv);
|
||||
|
@ -1068,6 +1068,7 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
|
||||
workitem.reports_supported |= STD_KEYBOARD;
|
||||
break;
|
||||
case 0x0f:
|
||||
case 0x11:
|
||||
device_type = "eQUAD Lightspeed 1.2";
|
||||
logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem);
|
||||
workitem.reports_supported |= STD_KEYBOARD;
|
||||
|
@ -2128,6 +2128,10 @@ static int nintendo_hid_probe(struct hid_device *hdev,
|
||||
spin_lock_init(&ctlr->lock);
|
||||
ctlr->rumble_queue = alloc_workqueue("hid-nintendo-rumble_wq",
|
||||
WQ_FREEZABLE | WQ_MEM_RECLAIM, 0);
|
||||
if (!ctlr->rumble_queue) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
INIT_WORK(&ctlr->rumble_worker, joycon_rumble_worker);
|
||||
|
||||
ret = hid_parse(hdev);
|
||||
|
@ -64,7 +64,9 @@ struct tm_wheel_info {
|
||||
*/
|
||||
static const struct tm_wheel_info tm_wheels_infos[] = {
|
||||
{0x0306, 0x0006, "Thrustmaster T150RS"},
|
||||
{0x0200, 0x0005, "Thrustmaster T300RS (Missing Attachment)"},
|
||||
{0x0206, 0x0005, "Thrustmaster T300RS"},
|
||||
{0x0209, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"},
|
||||
{0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"},
|
||||
{0x0002, 0x0002, "Thrustmaster T500RS"}
|
||||
//{0x0407, 0x0001, "Thrustmaster TMX"}
|
||||
@ -158,6 +160,12 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
|
||||
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];
|
||||
b_ep = ep->desc.bEndpointAddress;
|
||||
|
||||
|
@ -144,7 +144,7 @@ out:
|
||||
static int vivaldi_input_configured(struct hid_device *hdev,
|
||||
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[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user