Patch "net: bgmac: Drop free_netdev() from bgmac_enet_remove()" 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

    net: bgmac: Drop free_netdev() from bgmac_enet_remove()

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:
     net-bgmac-drop-free_netdev-from-bgmac_enet_remove.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 0e941d26a570b980838506165ef30ac8376c56c2
Author: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Date:   Wed Nov 9 15:01:36 2022 +0000

    net: bgmac: Drop free_netdev() from bgmac_enet_remove()
    
    [ Upstream commit 6f928ab8ee9bfbcb0e631c47ea8a16c3d5116ff1 ]
    
    netdev is allocated in bgmac_alloc() with devm_alloc_etherdev() and will
    be auto released in ->remove and ->probe failure path. Using free_netdev()
    in bgmac_enet_remove() leads to double free.
    
    Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it")
    Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
    
    Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@xxxxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index a4080f18135c..ae22f9f5761b 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1565,7 +1565,6 @@ void bgmac_enet_remove(struct bgmac *bgmac)
 	phy_disconnect(bgmac->net_dev->phydev);
 	netif_napi_del(&bgmac->napi);
 	bgmac_dma_free(bgmac);
-	free_netdev(bgmac->net_dev);
 }
 EXPORT_SYMBOL_GPL(bgmac_enet_remove);
 



[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