summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShixin Liu <liushixin2@huawei.com>2021-04-08 10:18:37 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-04-16 14:16:33 +0300
commit13343badae093977295341d5a050f51ef128821c (patch)
tree485a9a46eb4762ed63ee58fbb00ca1577122caa4 /drivers
parent747bf30fd944f02f341b5f3bc7d97a13f2ae2fbe (diff)
downloadlinux-13343badae093977295341d5a050f51ef128821c.tar.xz
crypto: sa2ul - Fix PM reference leak in sa_ul_probe()
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Signed-off-by: Shixin Liu <liushixin2@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/sa2ul.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index ca7484aac727..b0f0502a5bb0 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2354,7 +2354,7 @@ static int sa_ul_probe(struct platform_device *pdev)
dev_set_drvdata(sa_k3_dev, dev_data);
pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__,
ret);