From patchwork Tue Sep 29 11:00:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290845 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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 7D0E1C4727C for ; Tue, 29 Sep 2020 12:24:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28B192075F for ; Tue, 29 Sep 2020 12:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601382285; bh=XVGbZGXzyGzRewPWKVp/MbziheKaRme8wTSbBriuDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=s5A20F3dH+x91OJvZyYlXqmbO2O3JL2dl71fH3RXdUxgtGJmIl+jXMdgtVPNzB3Qx rBGhxvEP7hx5L5Q8r++nF1ORiTsdUwi8dYxGxQGykaW5AWiw5qN2kawyZLHvSZO2ok HXhJ86hOJyLixqWwBlVFZldL7y5nUHQe7/eW9i0U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729825AbgI2MYe (ORCPT ); Tue, 29 Sep 2020 08:24:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:53442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729775AbgI2LfJ (ORCPT ); Tue, 29 Sep 2020 07:35:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 798BA23C81; Tue, 29 Sep 2020 11:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378918; bh=XVGbZGXzyGzRewPWKVp/MbziheKaRme8wTSbBriuDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9HOQzZHl4N9iqa5QUryZES+9pqKRm5uTLnQLEJ2St3mF2ChVpkdnk+2JDIAeEBe2 uXcpG9RREOErnM6tCT9SJ3lCRHSM2SzYjvgqyOB6XirkRqjq6zTS6knVnOaUde7/m7 18E63SDwFKwlqiq8/M9MouV7mz/x1FMsC5gYb+BQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Miquel Raynal , Sasha Levin Subject: [PATCH 4.19 187/245] mtd: rawnand: omap_elm: Fix runtime PM imbalance on error Date: Tue, 29 Sep 2020 13:00:38 +0200 Message-Id: <20200929105956.075784651@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105946.978650816@linuxfoundation.org> References: <20200929105946.978650816@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ Upstream commit 37f7212148cf1d796135cdf8d0c7fee13067674b ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/omap_elm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c index a3f32f939cc17..6736777a41567 100644 --- a/drivers/mtd/nand/raw/omap_elm.c +++ b/drivers/mtd/nand/raw/omap_elm.c @@ -421,6 +421,7 @@ static int elm_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (pm_runtime_get_sync(&pdev->dev) < 0) { ret = -EINVAL; + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); dev_err(&pdev->dev, "can't enable clock\n"); return ret;