[PATCH net] net: ethernet: mtk_eth_soc: Fix potential PPE hash table leak
From: Guangshuo Li
Date: Thu Nov 12 2026 - 09:55:16 EST
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 <liguangshuo@xxxxxxxxxxxxxxx>
---
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(ð->rx_napi);
mtk_cleanup(eth);
free_netdev(eth->dummy_dev);
+ mtk_ppe_deinit(eth);
mtk_mdio_cleanup(eth);
}
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0