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

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>
This commit is contained in:
Geoffrey D. Bennett 2021-05-22 03:10:27 +09:30 committed by Greg Kroah-Hartman
parent 1eef795312
commit 08377263a9
1 changed files with 1 additions and 1 deletions

View 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);