public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: usbfs: remove double evaluation of usb_sndctrlpipe()
@ 2021-05-21 12:58 Geoffrey D. Bennett
  2021-05-21 13:17 ` Greg KH
  2021-05-21 14:39 ` Alan Stern
  0 siblings, 2 replies; 3+ messages in thread
From: Geoffrey D. Bennett @ 2021-05-21 12:58 UTC (permalink / raw)
  To: USB mailing list, Alan Stern; +Cc: Geoffrey D. Bennett

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().

Fixes: 4c6e8971cbe0 ("USB: make the "usbfs_snoop" log more pertinent")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
---
 drivers/usb/core/devio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 533236366a03..4a8ec136460c 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -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);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-21 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-21 12:58 [PATCH] USB: usbfs: remove double evaluation of usb_sndctrlpipe() Geoffrey D. Bennett
2021-05-21 13:17 ` Greg KH
2021-05-21 14:39 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox