Re: [PATCH net] eth: sp7021: drop free_netdev() from spl2sw_init_netdev()

From
Francois Romieu <romieu@fr.zoreil.com>
Date
2022-11-09 22:04:30
Reply to
Eric Dumazet, 2022-11-09
Eric Dumazet [off-list ref] :
[...]
quoted
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);
If the following leads to a double free, how the previous use of
ndev->name would actually work ?
The second free_netdev happens when device managed resources are released.
ndev->name above is used before the first free_netdev.

-- 
Ueimor
Thread (5 messages) 5 messages, 5 authors, last reply 2022-11-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help