From patchwork Tue Sep 29 11:00:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 291235 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=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 B4C7FC4727C for ; Tue, 29 Sep 2020 11:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6603721D92 for ; Tue, 29 Sep 2020 11:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377609; bh=AZyhVGJgpbhYzg3+kumaGZxjkK74KsqzH1d2Iwyom+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=weyON0I7BNb3GkfNh3sa9eB09oWcY6VdN6UPezxC3EWQ4Ds3INB1mVLbM8FNIIXi+ hc9KMif3bZsjwUpTvdadiRoIyGCBzSQ3PLtLjZ7rkMzualhheFFQRYghTF+1IDKHhj yQUEIux50vdi79eyPRrfY99p/horrJczBcgVjCvA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbgI2LGs (ORCPT ); Tue, 29 Sep 2020 07:06:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:44182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728835AbgI2LGk (ORCPT ); Tue, 29 Sep 2020 07:06:40 -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 144B821941; Tue, 29 Sep 2020 11:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377599; bh=AZyhVGJgpbhYzg3+kumaGZxjkK74KsqzH1d2Iwyom+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K0crUZymxUJgCZLdlqznYgRcmipbsfbhx0cGvtLDytUkpIYHOSnotcBb6CUSmX3Vu zvSte38/hCU4j1PPxgYYUgNugTR+UGbhJvTo3kE/qQUM7+h9kebJvLxIn+xSkQt37w H1jMo/wHvym4ZsPCh2mw9ayG+PXcAB3A26konyVg= 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.4 67/85] mtd: rawnand: omap_elm: Fix runtime PM imbalance on error Date: Tue, 29 Sep 2020 13:00:34 +0200 Message-Id: <20200929105931.568801981@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@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/omap_elm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/omap_elm.c b/drivers/mtd/nand/omap_elm.c index 235ec7992b4cf..e46b11847082a 100644 --- a/drivers/mtd/nand/omap_elm.c +++ b/drivers/mtd/nand/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;