Skip to content

Commit 4bc43a4

Browse files
jwrdegoedeJiri Kosina
authored andcommitted
HID: asus: Add hid_is_using_ll_driver(usb_hid_driver) check
Add a hid_is_using_ll_driver(usb_hid_driver) check to ensure that the parent device is an usb_interface, before casting the parent device pointer to an usb_interface pointer with to_usb_interface(). Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent a80b2f3 commit 4bc43a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/hid/hid-asus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,8 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
842842
if (drvdata->quirks & QUIRK_IS_MULTITOUCH)
843843
drvdata->tp = &asus_i2c_tp;
844844

845-
if (drvdata->quirks & QUIRK_T100_KEYBOARD) {
845+
if ((drvdata->quirks & QUIRK_T100_KEYBOARD) &&
846+
hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
846847
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
847848

848849
if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {

0 commit comments

Comments
 (0)