]> git.baikalelectronics.ru Git - kernel.git/commitdiff
litex_liteeth: Fix a double free in the remove function
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 7 Nov 2021 20:13:07 +0000 (21:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Nov 2021 21:51:17 +0000 (21:51 +0000)
'netdev' is a managed resource allocated in the probe using
'devm_alloc_etherdev()'.
It must not be freed explicitly in the remove function.

Fixes: 1896d58e447d ("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>
drivers/net/ethernet/litex/litex_liteeth.c

index ab9fa15250535e41bcbd834fc43eb42f57e394e6..fdd99f0de424dce95aba61410afcca7a8aa30838 100644 (file)
@@ -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;
 }