[PATCH] hwrng: exynos - fix runtime pm imbalance on error

From: Dinghao Liu
Date: Wed May 20 2020 - 09:19:40 EST


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@xxxxxxxxxx>
---
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