From: Christophe JAILLET Date: Sun, 7 Nov 2021 20:13:07 +0000 (+0100) Subject: litex_liteeth: Fix a double free in the remove function X-Git-Tag: v6.6.17~8844^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c45231a7668d6b632534f692b10592ea375b55b0;p=platform%2Fkernel%2Flinux-rpi.git litex_liteeth: Fix a double free in the remove function 'netdev' is a managed resource allocated in the probe using 'devm_alloc_etherdev()'. It must not be freed explicitly in the remove function. Fixes: ee7da21ac4c3 ("net: Add driver for LiteX's LiteETH network interface") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/litex/litex_liteeth.c b/drivers/net/ethernet/litex/litex_liteeth.c index ab9fa15..fdd99f0 100644 --- a/drivers/net/ethernet/litex/litex_liteeth.c +++ b/drivers/net/ethernet/litex/litex_liteeth.c @@ -287,7 +287,6 @@ static int liteeth_remove(struct platform_device *pdev) struct net_device *netdev = platform_get_drvdata(pdev); unregister_netdev(netdev); - free_netdev(netdev); return 0; }