Skip to content

Commit

Permalink
eth: sp7021: drop free_netdev() from spl2sw_init_netdev()
Browse files Browse the repository at this point in the history
It's not necessary to free netdev allocated with devm_alloc_etherdev()
and using free_netdev() leads to double free.

Fixes: fd3040b ("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>
  • Loading branch information
Wei Yongjun authored and Jakub Kicinski committed Nov 11, 2022
1 parent 6ce3df5 commit de91b31
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/net/ethernet/sunplus/spl2sw_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit de91b31

Please sign in to comment.