diff mbox series

[-next] crypto: omap-aes - fix the reference count leak of omap device

Message ID 20201027132510.81076-1-zhangqilong3@huawei.com
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series [-next] crypto: omap-aes - fix the reference count leak of omap device | expand

Commit Message

Zhang Qilong Oct. 27, 2020, 1:25 p.m. UTC
pm_runtime_get_sync() will increment  pm usage counter even
when it returns an error code. We should call put operation
in error handling paths of omap_aes_hw_init.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/crypto/omap-aes.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Herbert Xu Nov. 6, 2020, 3:30 a.m. UTC | #1
On Tue, Oct 27, 2020 at 09:25:10PM +0800, Zhang Qilong wrote:
> pm_runtime_get_sync() will increment  pm usage counter even
> when it returns an error code. We should call put operation
> in error handling paths of omap_aes_hw_init.
> 
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
>  drivers/crypto/omap-aes.c | 1 +
>  1 file changed, 1 insertion(+)

Your patch has already been applied:

commit 383e8a823014532ffd81c787ef9009f1c2bd3b79
Author: Zhang Qilong <zhangqilong3@huawei.com>
Date:   Fri Oct 16 17:05:36 2020 +0800

    crypto: omap-aes - fix the reference count leak of omap device

Cheers,
diff mbox series

Patch

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 4fd14d90cc40..70ea5784a024 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -105,6 +105,7 @@  static int omap_aes_hw_init(struct omap_aes_dev *dd)
 
 	err = pm_runtime_get_sync(dd->dev);
 	if (err < 0) {
+		pm_runtime_put_noidle(dd->dev);
 		dev_err(dd->dev, "failed to get sync: %d\n", err);
 		return err;
 	}