From patchwork Fri May 21 12:58:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Geoffrey D. Bennett" X-Patchwork-Id: 445083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 088CCC433ED for ; Fri, 21 May 2021 12:59:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8B226101B for ; Fri, 21 May 2021 12:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbhEUNAV (ORCPT ); Fri, 21 May 2021 09:00:21 -0400 Received: from m.b4.vu ([203.16.231.148]:50780 "EHLO m.b4.vu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbhEUNAU (ORCPT ); Fri, 21 May 2021 09:00:20 -0400 Received: by m.b4.vu (Postfix, from userid 1000) id 72411612FB20; Fri, 21 May 2021 22:28:56 +0930 (ACST) From: "Geoffrey D. Bennett" To: USB mailing list , Alan Stern Cc: "Geoffrey D. Bennett" Subject: [PATCH] USB: usbfs: remove double evaluation of usb_sndctrlpipe() Date: Fri, 21 May 2021 22:28:56 +0930 Message-Id: <20210521125856.116349-1-g@b4.vu> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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);