summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorZhang Qilong <zhangqilong3@huawei.com>2021-06-01 16:51:18 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2021-06-11 09:03:29 +0200
commitca323b2c61ec321eb9f2179a405b9c34cdb4f553 (patch)
treeaa125f89e0e9c1d9eecd4d83bdba98147d3301bf /drivers/crypto
parentcrypto: omap-des - using pm_runtime_resume_and_get instead of pm_runtime_get_... (diff)
downloadlinux-ca323b2c61ec321eb9f2179a405b9c34cdb4f553.tar.xz
linux-ca323b2c61ec321eb9f2179a405b9c34cdb4f553.zip
crypto: omap-sham - Fix PM reference leak in omap sham ops
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes: 604c31039dae4 ("crypto: omap-sham - Check for return value from pm_runtime_get_sync") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/omap-sham.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index ae0d320d3c60..dd53ad9987b0 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -372,7 +372,7 @@ static int omap_sham_hw_init(struct omap_sham_dev *dd)
{
int err;
- err = pm_runtime_get_sync(dd->dev);
+ err = pm_runtime_resume_and_get(dd->dev);
if (err < 0) {
dev_err(dd->dev, "failed to get sync: %d\n", err);
return err;
@@ -2244,7 +2244,7 @@ static int omap_sham_suspend(struct device *dev)
static int omap_sham_resume(struct device *dev)
{
- int err = pm_runtime_get_sync(dev);
+ int err = pm_runtime_resume_and_get(dev);
if (err < 0) {
dev_err(dev, "failed to get sync: %d\n", err);
return err;