[PATCH net] net: ethernet: mtk_eth_soc: Fix potential PPE hash table leak

From
Guangshuo Li <hidden>
Date
2026-11-12 13:59:13
Also in
linux-arm-kernel, linux-mediatek, lkml
The remove path does not destroy the PPE L2 flow hash tables. Their
bucket tables are not device-managed and remain allocated when the PPE
objects are released.

Call mtk_ppe_deinit() after unregistering the netdevs and cancelling the
driver work, as the probe error path already does.

This issue was found by our static analysis tool under development.

Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")
Signed-off-by: Guangshuo Li <redacted>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index ad0fdc4133fb..08973b6f0711 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -5426,6 +5426,7 @@ static void mtk_remove(struct platform_device *pdev)
 	netif_napi_del(&eth->rx_napi);
 	mtk_cleanup(eth);
 	free_netdev(eth->dummy_dev);
+	mtk_ppe_deinit(eth);
 	mtk_mdio_cleanup(eth);
 }
 
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.43.0
Thread (4 messages) 4 messages, 4 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help