summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2022-11-09 18:01:16 +0300
committerJakub Kicinski <kuba@kernel.org>2022-11-11 03:27:33 +0300
commitde91b3197d15172407608b2c357aab7ac1451e2b (patch)
tree20616aea5b2c35ae6c149e9afdc317f372dd677e /drivers/net/ethernet
parent6ce3df596be25d95c2cddc9e1b673394948e3732 (diff)
downloadlinux-de91b3197d15172407608b2c357aab7ac1451e2b.tar.xz
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: fd3040b9394c ("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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/sunplus/spl2sw_driver.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sunplus/spl2sw_driver.c b/drivers/net/ethernet/sunplus/spl2sw_driver.c
index 9be585237277..c499a14314f1 100644
--- a/drivers/net/ethernet/sunplus/spl2sw_driver.c
+++ b/drivers/net/ethernet/sunplus/spl2sw_driver.c
@@ -287,7 +287,6 @@ static u32 spl2sw_init_netdev(struct platform_device *pdev, u8 *mac_addr,
if (ret) {
dev_err(&pdev->dev, "Failed to register net device \"%s\"!\n",
ndev->name);
- free_netdev(ndev);
*r_ndev = NULL;
return ret;
}