Patch "crypto: stm32 - fix reference leak in stm32_crc_remove" has been added to the 5.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    crypto: stm32 - fix reference leak in stm32_crc_remove

to the 5.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     crypto-stm32-fix-reference-leak-in-stm32_crc_remove.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 78a3843c6272959d46ffab6066b235c5c20b94af
Author: Zheng Yongjun <zhengyongjun3@xxxxxxxxxx>
Date:   Thu Mar 17 13:16:13 2022 +0000

    crypto: stm32 - fix reference leak in stm32_crc_remove
    
    [ Upstream commit e9a36feecee0ee5845f2e0656f50f9942dd0bed3 ]
    
    pm_runtime_get_sync() will increment pm usage counter even it
    failed. Forgetting to call pm_runtime_put_noidle will result
    in reference leak in stm32_crc_remove, so we should fix it.
    
    Signed-off-by: Zheng Yongjun <zhengyongjun3@xxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c
index be1bf39a317d..90a920e7f664 100644
--- a/drivers/crypto/stm32/stm32-crc32.c
+++ b/drivers/crypto/stm32/stm32-crc32.c
@@ -384,8 +384,10 @@ static int stm32_crc_remove(struct platform_device *pdev)
 	struct stm32_crc *crc = platform_get_drvdata(pdev);
 	int ret = pm_runtime_get_sync(crc->dev);
 
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_noidle(crc->dev);
 		return ret;
+	}
 
 	spin_lock(&crc_list.lock);
 	list_del(&crc->list);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux