提交 6f928ab8 编写于 作者: W Wei Yongjun 提交者: Jakub Kicinski

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

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: 34a5102c ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>

Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@huaweicloud.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 c1754bf0
...@@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac) ...@@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac)
phy_disconnect(bgmac->net_dev->phydev); phy_disconnect(bgmac->net_dev->phydev);
netif_napi_del(&bgmac->napi); netif_napi_del(&bgmac->napi);
bgmac_dma_free(bgmac); bgmac_dma_free(bgmac);
free_netdev(bgmac->net_dev);
} }
EXPORT_SYMBOL_GPL(bgmac_enet_remove); EXPORT_SYMBOL_GPL(bgmac_enet_remove);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册