public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Geoffrey D. Bennett" <g@b4.vu>
To: USB mailing list <linux-usb@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: "Geoffrey D. Bennett" <g@b4.vu>
Subject: [PATCH] USB: usbfs: remove double evaluation of usb_sndctrlpipe()
Date: Fri, 21 May 2021 22:28:56 +0930	[thread overview]
Message-ID: <20210521125856.116349-1-g@b4.vu> (raw)

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


             reply	other threads:[~2021-05-21 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 12:58 Geoffrey D. Bennett [this message]
2021-05-21 13:17 ` [PATCH] USB: usbfs: remove double evaluation of usb_sndctrlpipe() Greg KH
2021-05-21 14:39 ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210521125856.116349-1-g@b4.vu \
    --to=g@b4.vu \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox