Patch "net: wilc1000: clean up resource in error path of init mon interface" has been added to the 5.9-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

    net: wilc1000: clean up resource in error path of init mon interface

to the 5.9-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:
     net-wilc1000-clean-up-resource-in-error-path-of-init.patch
and it can be found in the queue-5.9 subdirectory.

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



commit 8a856398512ebc7c492b3fb258d1ffe403aeb347
Author: Huang Guobin <huangguobin4@xxxxxxxxxx>
Date:   Thu Sep 17 08:30:19 2020 -0400

    net: wilc1000: clean up resource in error path of init mon interface
    
    [ Upstream commit 55bd149978679742374c800e56e8f6bc74378bbe ]
    
    The wilc_wfi_init_mon_int() forgets to clean up resource when
    register_netdevice() failed. Add the missed call to fix it.
    And the return value of netdev_priv can't be NULL, so remove
    the unnecessary error handling.
    
    Fixes: 588713006ea4 ("staging: wilc1000: avoid the use of 'wilc_wfi_mon' static variable")
    Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
    Signed-off-by: Huang Guobin <huangguobin4@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200917123019.206382-1-huangguobin4@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/microchip/wilc1000/mon.c b/drivers/net/wireless/microchip/wilc1000/mon.c
index 358ac86013338..b5a1b65c087ca 100644
--- a/drivers/net/wireless/microchip/wilc1000/mon.c
+++ b/drivers/net/wireless/microchip/wilc1000/mon.c
@@ -235,11 +235,10 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
 
 	if (register_netdevice(wl->monitor_dev)) {
 		netdev_err(real_dev, "register_netdevice failed\n");
+		free_netdev(wl->monitor_dev);
 		return NULL;
 	}
 	priv = netdev_priv(wl->monitor_dev);
-	if (!priv)
-		return NULL;
 
 	priv->real_ndev = real_dev;
 



[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