Patch "crypto: ccree - Remove debugfs when platform_driver_register failed" has been added to the 5.15-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: ccree - Remove debugfs when platform_driver_register failed

to the 5.15-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-ccree-remove-debugfs-when-platform_driver_reg.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 8b63dbf3a964877080e3a8a9dedf4fe285f2af24
Author: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
Date:   Tue Nov 8 16:29:12 2022 +0800

    crypto: ccree - Remove debugfs when platform_driver_register failed
    
    [ Upstream commit 4f1c596df706c9aca662b6c214fad84047ae2a97 ]
    
    When platform_driver_register failed, we need to remove debugfs,
    which will caused a resource leak, fix it.
    
    Failed logs as follows:
    [   32.606488] debugfs: Directory 'ccree' with parent '/' already present!
    
    Fixes: 4c3f97276e15 ("crypto: ccree - introduce CryptoCell driver")
    Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c
index 790fa9058a36..41f0a404bdf9 100644
--- a/drivers/crypto/ccree/cc_driver.c
+++ b/drivers/crypto/ccree/cc_driver.c
@@ -656,9 +656,17 @@ static struct platform_driver ccree_driver = {
 
 static int __init ccree_init(void)
 {
+	int rc;
+
 	cc_debugfs_global_init();
 
-	return platform_driver_register(&ccree_driver);
+	rc = platform_driver_register(&ccree_driver);
+	if (rc) {
+		cc_debugfs_global_fini();
+		return rc;
+	}
+
+	return 0;
 }
 module_init(ccree_init);
 



[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