Skip to content

Commit 6b32391

Browse files
jhovolddtor
authored andcommitted
Input: sur40 - fix interface sanity checks
Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. This in turn could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: bdb5c57 ("Input: add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)") Signed-off-by: Johan Hovold <[email protected]> Acked-by: Vladis Dronov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent cea7991 commit 6b32391

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/touchscreen/sur40.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static int sur40_probe(struct usb_interface *interface,
661661
int error;
662662

663663
/* Check if we really have the right interface. */
664-
iface_desc = &interface->altsetting[0];
664+
iface_desc = interface->cur_altsetting;
665665
if (iface_desc->desc.bInterfaceClass != 0xFF)
666666
return -ENODEV;
667667

0 commit comments

Comments
 (0)