linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwrng: exynos - fix runtime pm imbalance on error
@ 2020-05-20 13:19 Dinghao Liu
       [not found] ` <CGME20200521135309eucas1p1c0734570f04660c8b60ea12531f53e60@eucas1p1.samsung.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Dinghao Liu @ 2020-05-20 13:19 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: linux-samsung-soc, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Łukasz Stelmach, linux-kernel, Krzysztof Kozlowski,
	Kukjin Kim, linux-crypto, Matt Mackall, linux-arm-kernel

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 <dinghao.liu@zju.edu.cn>
---
 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;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread
[parent not found: <CGME20210422101724eucas1p13e2f002b63fe94ef2aa5268383f3a207@eucas1p1.samsung.com>]

end of thread, other threads:[~2021-04-22 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 13:19 [PATCH] hwrng: exynos - fix runtime pm imbalance on error Dinghao Liu
     [not found] ` <CGME20200521135309eucas1p1c0734570f04660c8b60ea12531f53e60@eucas1p1.samsung.com>
2020-05-21 13:52   ` Lukasz Stelmach
     [not found] <CGME20210422101724eucas1p13e2f002b63fe94ef2aa5268383f3a207@eucas1p1.samsung.com>
2021-04-22 10:17 ` [PATCH] hwrng: exynos - Fix runtime PM " Łukasz Stelmach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).