From patchwork Sat Mar 24 13:56:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10306053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83E81600CC for ; Sat, 24 Mar 2018 13:57:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74089292CE for ; Sat, 24 Mar 2018 13:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66A9A292C9; Sat, 24 Mar 2018 13:57:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02350292C9 for ; Sat, 24 Mar 2018 13:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=2BwuPEl8K2AQOBpMcV703TNVmEgWS6lstceeRlzfZmc=; b=OXG FyMjPs8UJAddKN2daU+Fg1YAX2bsNoruEPgFPL/e829FRzNTO0mY3EVivc0hlTMLVH4fEFuoW9YEM /AAcpnJ3X2SCOarIQWgnLIols655k7DTI/H//ATr3um3EZnAhALqPPJn84fsmSV/rp5Ophpqk8xcP DEq8ky6BshljchZTIbJIBY9FtAFbzhiPLxsswYZa1SwkJTeZ1D/jflhhX4N9uUo/2ejjblruFFqAJ ZmTK2VOGzaYf2RoJPE8rMOJNCrTCkDe/8Gz2rRO3ZAGJHUFUCW5qcB8S2wlE9lsq3t6yWZupP2l5J SKUYMxTTc6bUKmm/L3O0XAFUUU2TiRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezjfO-0005pT-2y; Sat, 24 Mar 2018 13:57:06 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezjfL-0005nT-4Q for linux-amlogic@lists.infradead.org; Sat, 24 Mar 2018 13:57:04 +0000 Received: by mail-wm0-x243.google.com with SMTP id a20so10563247wmd.1 for ; Sat, 24 Mar 2018 06:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dr6+NIGsMqIQ6GnELxzwiMuTmdvTPEDoK6KSEXeL62g=; b=bIB7xg/CiCsY70tsGISrRrTxwz+D2QHNCr9CnzBIH+JOUhSFTHEyH1GPNT/fjG4Hn3 OrJeiNQ6y/VUSCI4pR9l0R70tLdos39YWz9D6Vm5AzlicByPrxKiVV94hPQST/1bJW6d 3nwAYmMxQ3RLl+wpgm2ereJLKvOA71esREA3Pxg/jlWjLDWZ1+Q4ut2bdYUhbkfnxIL8 B968Gt0INBOfxgS1bh8UMV0MnahQaIJSqCDnjvJq4nd8gOP6O+d0HRZVBOtFpeJrDynr TniGC7K3mfdZjwGPf8GnNLYVbtqRMBko4CLP7I47GFe2Czy0alu+0A13cPm1zzRem4Gk tP/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dr6+NIGsMqIQ6GnELxzwiMuTmdvTPEDoK6KSEXeL62g=; b=PjP0Gf26tbQcw/WLRFxpGx1KcW1edTH5Qtv1Fz5toWnvDrtiMAyOtgm84N0+lb+1Hx op34ZLMwCEQPpPaINvHp0t/mpjNbbW1fF2ViuLmft+dwNWDoXnP2lrfhemQXZHxdSpo6 oL3z0z9ntsacr2V8FhAuZ0pZabbPhGSB9v2fLPPin48ipD6Y9VmP6K3gR6cGyaaktLKx 27gYPbJELxnR4T1QywQg+Gn3ytZC0cASjM6aReTgELbQYDoOU4x83/T4m2bQ9QbpuCyT zPk1c5MnpvMewTYWWHz51e2UpweWCHr7hnA4MLgH310pYXPLNDkahklmDL6GLcU3vhTC KeDQ== X-Gm-Message-State: AElRT7FmY34+72PAaOClB/1lUeS8bxFEtmJKz72sM1ucjzBPOPQNFkSk ZA5s8859PDP9lWseHZmDBs0= X-Google-Smtp-Source: AG47ELunZ2J2fu4n7fCnXgHaHxjIOsXeZosS1ZgV+fiQ+hSQqXAhBbpVobAUBE0WHWfkucFjezw8OQ== X-Received: by 10.28.16.18 with SMTP id 18mr10817260wmq.81.1521899811066; Sat, 24 Mar 2018 06:56:51 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7416504613646B2A165589A.dip0.t-ipconnect.de. [2003:dc:d741:6504:6136:46b2:a165:589a]) by smtp.googlemail.com with ESMTPSA id b38sm16635216wrg.81.2018.03.24.06.56.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Mar 2018 06:56:50 -0700 (PDT) From: Martin Blumenstingl To: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org Subject: [PATCH usb-next v1] usb: core: phy: fix return value of usb_phy_roothub_exit() Date: Sat, 24 Mar 2018 14:56:29 +0100 Message-Id: <20180324135629.31409-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.16.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180324_065703_315774_363EAE90 X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chunfeng.yun@mediatek.com, linux-amlogic@lists.infradead.org, Martin Blumenstingl , rogerq@ti.com MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP usb_phy_roothub_exit() should return the error code from the phy_exit() call if exiting the PHY failed. However, since a wrong variable is used usb_phy_roothub_exit() currently always returns 0, even if one of the phy_exit calls returned an error. Fix this by assigning the error code from phy_exit() to the "ret" variable to propagate the error correctly. Fixes: 07dbff0ddbd86c ("usb: core: add a wrapper for the USB PHYs on the HCD") Signed-off-by: Martin Blumenstingl --- drivers/usb/core/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c index 09b7c43c0ea4..f19aaa3c899c 100644 --- a/drivers/usb/core/phy.c +++ b/drivers/usb/core/phy.c @@ -111,7 +111,7 @@ int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub) list_for_each_entry(roothub_entry, head, list) { err = phy_exit(roothub_entry->phy); if (err) - ret = ret; + ret = err; } return ret;