summaryrefslogtreecommitdiff
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 06:11:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 06:11:06 +0100
commit2919c4a3d883361105185f9d2f658e1a4545a1a7 (patch)
tree9c15baa31ab3933c8e123a4492986532d568624d /drivers/usb/class
parent594c82329eef335ad90f5276ae0d2dff4d6d2668 (diff)
parent5bc55a333a2f7316b58edc7573e8e893f7acb532 (diff)
Merge 6.13-rc7 into usb-next
We need the USB fixes in here as well for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/usblp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 0f422f6c28e9..e2527faa6592 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1337,11 +1337,12 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL)
return -EINVAL;
+ alts = usblp->protocol[protocol].alt_setting;
+ if (alts < 0)
+ return -EINVAL;
+
/* Don't unnecessarily set the interface if there's a single alt. */
if (usblp->intf->num_altsetting > 1) {
- alts = usblp->protocol[protocol].alt_setting;
- if (alts < 0)
- return -EINVAL;
r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
if (r < 0) {
printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",