From patchwork Wed May 20 13:19:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinghao Liu X-Patchwork-Id: 11560465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA53914B7 for ; Wed, 20 May 2020 13:37:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CA64207F9 for ; Wed, 20 May 2020 13:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbgETNho (ORCPT ); Wed, 20 May 2020 09:37:44 -0400 Received: from aliyun-cloud.icoremail.net ([47.90.88.95]:55917 "HELO aliyun-sdnproxy-1.icoremail.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1726436AbgETNho (ORCPT ); Wed, 20 May 2020 09:37:44 -0400 X-Greylist: delayed 715 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 May 2020 09:37:42 EDT Received: from localhost.localdomain (unknown [222.205.77.158]) by mail-app4 (Coremail) with SMTP id cS_KCgC3wD1PLsVemdraAQ--.40219S4; Wed, 20 May 2020 21:19:16 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: =?utf-8?q?=C5=81ukasz_Stelmach?= , Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwrng: exynos - fix runtime pm imbalance on error Date: Wed, 20 May 2020 21:19:10 +0800 Message-Id: <20200520131911.16813-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: cS_KCgC3wD1PLsVemd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GvfC2KfnxnUUI43ZEXa7VUb_gA7UUUUU== X-CM-SenderInfo: qrrzjiaqtzq6lmxovvfxof0/ Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org pm_runtime_get_sync() increments the runtime PM usage counter even the call 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 --- drivers/char/hw_random/exynos-trng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c index 8e1fe3f8dd2d..133e017db577 100644 --- a/drivers/char/hw_random/exynos-trng.c +++ b/drivers/char/hw_random/exynos-trng.c @@ -165,9 +165,8 @@ static int exynos_trng_probe(struct platform_device *pdev) clk_disable_unprepare(trng->clk); err_clock: - pm_runtime_put_sync(&pdev->dev); - err_pm_get: + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return ret;