From 4a6764900678c92dc5fa17d59082698ef44260f8 Mon Sep 17 00:00:00 2001 From: Guangshuo Li Date: Wed, 16 Sep 2026 11:14:14 +0800 Subject: [PATCH] net: fs_enet: fix platform info memory leak on remove fs_enet_probe() allocates the platform information structure with kzalloc_obj() and stores it in fep->fpi. The probe failure paths release this allocation with kfree(). However, after a successful probe, fs_enet_remove() tears down the network device without freeing fep->fpi, leaving the platform information structure allocated after driver removal. Free fep->fpi before releasing the network device. This issue was found by manual code inspection. Cc: stable+noautosel@kernel.org # untested fix to a driver init path Signed-off-by: Guangshuo Li Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260916031414.2875022-1-lgs201920130244@gmail.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index d3c772ed5fc9..071e3f3de78c 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -1007,6 +1007,7 @@ static void fs_enet_remove(struct platform_device *ofdev) fep->ops->cleanup_data(ndev); dev_set_drvdata(fep->dev, NULL); phylink_destroy(fep->phylink); + kfree(fep->fpi); free_netdev(ndev); }