Skip to contentSkip to conversation

USB: usbfs: remove double evaluation of usb_sndctrlpipe()

PATCH Superseded Geoffrey D. Bennett 3 participants 3 messages May 21, 2021 USB

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: usbfs: remove double evaluation of usb_sndctrlpipe()

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")
---
 drivers/usb/core/devio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/devio.c +1 -1
index 533236366a03..4a8ec136460c 100644
@@ -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);
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 5 lines · 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")

There is no bug here to "fix" this is just a cleanup.

Can you drop this and then properly cc: the needed developers when you resend a v2?

thanks,

greg k-h

Acked-by on v1 1/1
#2 lore raw
In reply to Geoffrey D. Bennett
Quoted 15 lines · 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")
---
 drivers/usb/core/devio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/devio.c +0 -0
index 533236366a03..4a8ec136460c 100644

drivers/usb/core/devio.c static int do_proc_control(struct usb_dev_state *ps, · line 1168

Quoted 8 lines
drivers/usb/core/devio.c +1 -1
@@ -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);

When you resubmit without the Fixes: tag, you can add:

Alan Stern