Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: gs_usb: gs_usb_probe(): use descriptors of current altsetting

Make sure to always use the descriptors of the current alternate setting
to avoid future issues when accessing fields that may differ between
settings.

Signed-off-by: Johan Hovold <johan@kernel.org>
Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Johan Hovold and committed by
Marc Kleine-Budde
2f361cd9 5660493c

+2 -2
+2 -2
drivers/net/can/usb/gs_usb.c
··· 918 918 GS_USB_BREQ_HOST_FORMAT, 919 919 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, 920 920 1, 921 - intf->altsetting[0].desc.bInterfaceNumber, 921 + intf->cur_altsetting->desc.bInterfaceNumber, 922 922 hconf, 923 923 sizeof(*hconf), 924 924 1000); ··· 941 941 GS_USB_BREQ_DEVICE_CONFIG, 942 942 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, 943 943 1, 944 - intf->altsetting[0].desc.bInterfaceNumber, 944 + intf->cur_altsetting->desc.bInterfaceNumber, 945 945 dconf, 946 946 sizeof(*dconf), 947 947 1000);