Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Christophe JAILLET and committed by
David S. Miller
c45231a7 9fec40f8

-1
-1
drivers/net/ethernet/litex/litex_liteeth.c
··· 287 287 struct net_device *netdev = platform_get_drvdata(pdev); 288 288 289 289 unregister_netdev(netdev); 290 - free_netdev(netdev); 291 290 292 291 return 0; 293 292 }