eth: sp7021: drop free_netdev() from spl2sw_init_netdev()

It's not necessary to free netdev allocated with devm_alloc_etherdev()
and using free_netdev() leads to double free.

Fixes: fd3040b939 ("net: ethernet: Add driver for Sunplus SP7021")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20221109150116.2988194-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Wei Yongjun 2022-11-09 15:01:16 +00:00 committed by Jakub Kicinski
parent 6ce3df596b
commit de91b3197d

View File

@ -287,7 +287,6 @@ static u32 spl2sw_init_netdev(struct platform_device *pdev, u8 *mac_addr,
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to register net device \"%s\"!\n", dev_err(&pdev->dev, "Failed to register net device \"%s\"!\n",
ndev->name); ndev->name);
free_netdev(ndev);
*r_ndev = NULL; *r_ndev = NULL;
return ret; return ret;
} }