]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:33:39 +0000 (07:33 +0100)
BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit c45231a7668d6b632534f692b10592ea375b55b0 ]

'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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/litex/litex_liteeth.c

index a9bdbf0dcfe1ed63819bd9eeb0859ded01bc61b6..5bb1cc8a2ce13bd82e5aeb431a9d4ce76c1f60a4 100644 (file)
@@ -289,7 +289,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;
 }