Skip to content

Commit 74ca341

Browse files
jhovoldgregkh
authored andcommitted
staging: rtl8188eu: fix interface sanity check
Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. Failing to do so 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: c2478d3 ("staging: r8188eu: Add files for new driver - part 20") Cc: stable <[email protected]> # 3.12 Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ed9ed5a commit 74ca341

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/rtl8188eu/os_dep/usb_intf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
7070
phost_conf = pusbd->actconfig;
7171
pconf_desc = &phost_conf->desc;
7272

73-
phost_iface = &usb_intf->altsetting[0];
73+
phost_iface = usb_intf->cur_altsetting;
7474
piface_desc = &phost_iface->desc;
7575

7676
pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;

0 commit comments

Comments
 (0)