Skip to content

Commit 1c3e979

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: - NULL pointer dereference fix in Vivaldi driver (Jiasheng Jiang) - regression fix for device probing in Holtek driver (Benjamin Tissoires) * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: potential dereference of null pointer HID: holtek: fix mouse probing
2 parents 6e0567b + 13251ce commit 1c3e979

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

drivers/hid/hid-holtek-mouse.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,23 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
6565
static int holtek_mouse_probe(struct hid_device *hdev,
6666
const struct hid_device_id *id)
6767
{
68+
int ret;
69+
6870
if (!hid_is_usb(hdev))
6971
return -EINVAL;
72+
73+
ret = hid_parse(hdev);
74+
if (ret) {
75+
hid_err(hdev, "hid parse failed: %d\n", ret);
76+
return ret;
77+
}
78+
79+
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
80+
if (ret) {
81+
hid_err(hdev, "hw start failed: %d\n", ret);
82+
return ret;
83+
}
84+
7085
return 0;
7186
}
7287

drivers/hid/hid-vivaldi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ static int vivaldi_probe(struct hid_device *hdev,
5757
int ret;
5858

5959
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
60+
if (!drvdata)
61+
return -ENOMEM;
62+
6063
hid_set_drvdata(hdev, drvdata);
6164

6265
ret = hid_parse(hdev);

0 commit comments

Comments
 (0)