[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618172103.312f1e24@kernel.org>
Date: Tue, 18 Jun 2024 17:21:03 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: David Wei <dw@...idwei.uk>
Cc: edward.cree@....com, linux-net-drivers@....com, davem@...emloft.com,
edumazet@...gle.com, pabeni@...hat.com, Edward Cree
<ecree.xilinx@...il.com>, netdev@...r.kernel.org, habetsm.xilinx@...il.com,
sudheer.mogilappagari@...el.com, jdamato@...tly.com, mw@...ihalf.com,
linux@...linux.org.uk, sgoutham@...vell.com, gakula@...vell.com,
sbhatta@...vell.com, hkelam@...vell.com, saeedm@...dia.com,
leon@...nel.org, jacob.e.keller@...el.com, andrew@...n.ch,
ahmed.zaki@...el.com
Subject: Re: [PATCH v5 net-next 1/7] net: move ethtool-related netdev state
into its own struct
On Tue, 18 Jun 2024 16:45:56 -0700 David Wei wrote:
> >> dev->ethtool = NULL?
> >
> > defensive programming is sometimes permitted by not encouraged :)
>
> I've been here enough to know this bit!
>
> But, kfree(foo) followed by foo = NULL is a common pattern I see in
> kernel code. free_netdev() does it a bit further down. Is this pattern
> deprecated, then?
I wouldn't say its deprecated. But I'd certainly let the author choose
not to do this, especially on a straightforward path like free_netdev()
Powered by blists - more mailing lists