mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
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: 34a5102c32 ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
bec9ded540
commit
d697f78cab
1 changed files with 0 additions and 1 deletions
|
|
@ -1564,7 +1564,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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue