Patch "HSI: omap_ssi_core: Fix error handling in ssi_init()" has been added to the 4.14-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

    HSI: omap_ssi_core: Fix error handling in ssi_init()

to the 4.14-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:
     hsi-omap_ssi_core-fix-error-handling-in-ssi_init.patch
and it can be found in the queue-4.14 subdirectory.

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



commit 8a2094ca94b92207c518f2e2246a453ac25c7b10
Author: Yuan Can <yuancan@xxxxxxxxxx>
Date:   Thu Nov 24 11:33:32 2022 +0000

    HSI: omap_ssi_core: Fix error handling in ssi_init()
    
    [ Upstream commit 3ffa9f713c39a213a08d9ff13ab983a8aa5d8b5d ]
    
    The ssi_init() returns the platform_driver_register() directly without
    checking its return value, if platform_driver_register() failed, the
    ssi_pdriver is not unregistered.
    Fix by unregister ssi_pdriver when the last platform_driver_register()
    failed.
    
    Fixes: 0fae198988b8 ("HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module")
    Signed-off-by: Yuan Can <yuancan@xxxxxxxxxx>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
index fa3835ec5104..09653b064d93 100644
--- a/drivers/hsi/controllers/omap_ssi_core.c
+++ b/drivers/hsi/controllers/omap_ssi_core.c
@@ -667,7 +667,13 @@ static int __init ssi_init(void) {
 	if (ret)
 		return ret;
 
-	return platform_driver_register(&ssi_port_pdriver);
+	ret = platform_driver_register(&ssi_port_pdriver);
+	if (ret) {
+		platform_driver_unregister(&ssi_pdriver);
+		return ret;
+	}
+
+	return 0;
 }
 module_init(ssi_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