[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2wjuPAww2tZLbIx@electric-eye.fr.zoreil.com>
Date: Wed, 9 Nov 2022 23:03:36 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Wei Yongjun <weiyongjun@...weicloud.com>,
Wells Lu <wellslutw@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Wei Yongjun <weiyongjun1@...wei.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net] eth: sp7021: drop free_netdev() from
spl2sw_init_netdev()
Eric Dumazet <edumazet@...gle.com> :
[...]
> > 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
Powered by blists - more mailing lists