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: 9644259 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 EC13260327 for ; Sat, 25 Mar 2017 00:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE83327165 for ; Sat, 25 Mar 2017 00:05:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2EA427D29; Sat, 25 Mar 2017 00:05:35 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DDFC27165 for ; Sat, 25 Mar 2017 00:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936665AbdCYAFY (ORCPT ); Fri, 24 Mar 2017 20:05:24 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:58302 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936657AbdCYAFU (ORCPT ); Fri, 24 Mar 2017 20:05:20 -0400 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 Cc: Shuah Khan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org 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: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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: