All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: sun8i-ce - fix runtime pm imbalance on error
@ 2020-05-20  7:54 ` Dinghao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Dinghao Liu @ 2020-05-20  7:54 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Corentin Labbe, Herbert Xu, David S. Miller, Maxime Ripard,
	Chen-Yu Tsai, Chen Zhou, Colin Ian King, linux-crypto,
	linux-arm-kernel, linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
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 <dinghao.liu@zju.edu.cn>
---
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
index 3e4e4bbda34c..18f0f251204c 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c
@@ -598,8 +598,10 @@ static int sun8i_ce_probe(struct platform_device *pdev)
 		goto error_alg;
 
 	err = pm_runtime_get_sync(ce->dev);
-	if (err < 0)
+	if (err < 0) {
+		pm_runtime_put_sync(ce->dev);
 		goto error_alg;
+	}
 
 	v = readl(ce->base + CE_CTR);
 	v >>= CE_DIE_ID_SHIFT;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-20  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  7:54 [PATCH] crypto: sun8i-ce - fix runtime pm imbalance on error Dinghao Liu
2020-05-20  7:54 ` Dinghao Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.