Skip to contentSkip to conversation

USB: usbfs: remove double evaluation of usb_sndctrlpipe()

PATCH New Geoffrey D. Bennett 1 participant 1 message May 21, 2021 USB

lore
Share & tools
lore
#0 lore raw

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

---
 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