]> git.baikalelectronics.ru Git - kernel.git/commitdiff
eth: sp7021: drop free_netdev() from spl2sw_init_netdev()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 9 Nov 2022 15:01:16 +0000 (15:01 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Nov 2022 00:27:33 +0000 (16:27 -0800)
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>
drivers/net/ethernet/sunplus/spl2sw_driver.c

index 9be5852372773f13c3facc868e0f7e014492e519..c499a14314f13d03fe339b4423b1cb318889151d 100644 (file)
@@ -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;
        }