From patchwork Sat Mar 25 00:04:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9644277 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 74CF160327 for ; Sat, 25 Mar 2017 00:06:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 667BA26907 for ; Sat, 25 Mar 2017 00:06:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AEEE279E0; Sat, 25 Mar 2017 00:06:24 +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_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 EDBE526907 for ; Sat, 25 Mar 2017 00:06:23 +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:References: In-Reply-To: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:List-Owner; bh=KGLOtlwiZbZ7ZsPmRBCOqQxVp1nsoVxGHf3dI3Cvvzg=; b=LKj1yfeBOUZWGO1dKZycVqfGFH XPxn8SGjS5tiUiCgTh3nUnlAQ4jT/EL3xDJLxpq5Shr66O+EAavebzgONF7+t2ZwrpSpVEFAPfY3v ZKPSNstJ+U2ldGnd/JWFn/0LKvsvfvwkyt/EfMfR43RZ+paqsZh4HA53gJ1IjAlFdZ1RB1MKLN+lM GX2jbLNnN2alzSV8tiDNi+YqXocb5mhCpL+NkIcKfrcIlTQPuHpaR8S+Vphl/gcNLeeClvM1RF98b DTfsFO5h/gYw1E5tP6WfCS+O6AXExEZP3s58ww3ZQ6eKCh3Qzlg3eqOo1u0/6rtYOhoHtlMa9OGZ9 pWM4OMGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZDp-0003QZ-2O; Sat, 25 Mar 2017 00:06:21 +0000 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49] helo=osg.samsung.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crZD4-0002gw-2M for linux-arm-kernel@lists.infradead.org; Sat, 25 Mar 2017 00:05:37 +0000 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id E28B6A05F0; Sat, 25 Mar 2017 00:05:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wfupbuh_FW1s; Sat, 25 Mar 2017 00:05:35 +0000 (UTC) Received: from localhost.localdomain (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by osg.samsung.com (Postfix) with ESMTPSA id DD647A05EB; Sat, 25 Mar 2017 00:05:34 +0000 (UTC) From: Shuah Khan To: balbi@kernel.org, gregkh@linuxfoundation.org, kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com Subject: [PATCH 1/7] usb: dwc3: core: fix dwc3_probe() to not do put_sync when get_sync fails Date: Fri, 24 Mar 2017 18:04:59 -0600 Message-Id: <2238ea52423a83118ab724a96e8f0691ec4ada0b.1490387086.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_170534_184033_58ECB21F X-CRM114-Status: UNSURE ( 6.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, Shuah Khan , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP dwc3_probe() does pm_runtime_put_sync() in its err1 handling when pm_runtime_get_sync() fails. Move the pm_runtime_put_sync() under err2 instead as it is used in error paths after pm_runtime_get_sync() succeeds. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 56f1367..0fc7bef 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1162,9 +1162,9 @@ static int dwc3_probe(struct platform_device *pdev) err2: pm_runtime_allow(&pdev->dev); + pm_runtime_put_sync(&pdev->dev); err1: - pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); err0: