lkml.org 
[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] crypto: sun8i-ss - fix runtime pm imbalance on error
Date
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-ss/sun8i-ss-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
index 6b301afffd11..41841415ead6 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c
@@ -571,8 +571,10 @@ static int sun8i_ss_probe(struct platform_device *pdev)
goto error_alg;

err = pm_runtime_get_sync(ss->dev);
- if (err < 0)
+ if (err < 0) {
+ pm_runtime_put_sync(ss->dev);
goto error_alg;
+ }

v = readl(ss->base + SS_CTL_REG);
v >>= SS_DIE_ID_SHIFT;
--
2.17.1
\
 
 \ /
  Last update: 2020-05-20 10:13    [W:0.416 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site