Subject: Re: [PATCH v5 net-next 1/7] net: move ethtool-related netdev state into its own struct

From: Jakub Kicinski <[email-masked]>
Date: Tue, 18 Jun 2024 17:21:03 -0700

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()