USB: usbfs: remove double evaluation of usb_sndctrlpipe()
authorGeoffrey D. Bennett <g@b4.vu>
Fri, 21 May 2021 17:40:27 +0000 (03:10 +0930)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 May 2021 13:27:14 +0000 (15:27 +0200)
usb_sndctrlpipe() is evaluated in do_proc_control(), saved in a
variable, then evaluated again. Use the saved variable instead, to
match the use of usb_rcvctrlpipe().

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/20210521174027.GA116484@m.b4.vu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c

index 533236366a03b8d35b8c6a724946dff6d9fe44b3..4a8ec136460cd62f3264a8f47e579658ad47e7a3 100644 (file)
@@ -1162,7 +1162,7 @@ static int do_proc_control(struct usb_dev_state *ps,
                        tbuf, ctrl->wLength);
 
                usb_unlock_device(dev);
-               i = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ctrl->bRequest,
+               i = usb_control_msg(dev, pipe, ctrl->bRequest,
                                    ctrl->bRequestType, ctrl->wValue, ctrl->wIndex,
                                    tbuf, ctrl->wLength, tmo);
                usb_lock_device(dev);