Skip to content

Commit

Permalink
litex_liteeth: Fix a double free in the remove function
Browse files Browse the repository at this point in the history
'netdev' is a managed resource allocated in the probe using
'devm_alloc_etherdev()'.
It must not be freed explicitly in the remove function.

Fixes: ee7da21 ("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>
  • Loading branch information
Christophe JAILLET authored and David S. Miller committed Nov 7, 2021
1 parent 9fec40f commit c45231a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/net/ethernet/litex/litex_liteeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c45231a

Please sign in to comment.