Patch "wifi: wfx: Fix error handling in wfx_core_init()" has been added to the 6.6-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

    wifi: wfx: Fix error handling in wfx_core_init()

to the 6.6-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:
     wifi-wfx-fix-error-handling-in-wfx_core_init.patch
and it can be found in the queue-6.6 subdirectory.

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



commit b9de501af8de7ab8c9988a2b6426f563027b6900
Author: Yuan Can <yuancan@xxxxxxxxxx>
Date:   Tue Oct 22 17:04:53 2024 +0800

    wifi: wfx: Fix error handling in wfx_core_init()
    
    [ Upstream commit 3b88a9876779b55478a4dde867e73f7a100ffa23 ]
    
    The wfx_core_init() returns without checking the retval from
    sdio_register_driver().
    If the sdio_register_driver() failed, the module failed to install,
    leaving the wfx_spi_driver not unregistered.
    
    Fixes: a7a91ca5a23d ("staging: wfx: add infrastructure for new driver")
    Signed-off-by: Yuan Can <yuancan@xxxxxxxxxx>
    Reviewed-by: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241022090453.84679-1-yuancan@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index ede822d771aaf..f2409830d87e3 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -475,10 +475,23 @@ static int __init wfx_core_init(void)
 {
 	int ret = 0;
 
-	if (IS_ENABLED(CONFIG_SPI))
+	if (IS_ENABLED(CONFIG_SPI)) {
 		ret = spi_register_driver(&wfx_spi_driver);
-	if (IS_ENABLED(CONFIG_MMC) && !ret)
+		if (ret)
+			goto out;
+	}
+	if (IS_ENABLED(CONFIG_MMC)) {
 		ret = sdio_register_driver(&wfx_sdio_driver);
+		if (ret)
+			goto unregister_spi;
+	}
+
+	return 0;
+
+unregister_spi:
+	if (IS_ENABLED(CONFIG_SPI))
+		spi_unregister_driver(&wfx_spi_driver);
+out:
 	return ret;
 }
 module_init(wfx_core_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