Thread (21 messages) flat view 21 messages, 4 authors, 2024-06-20

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

From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-06-19 00:21:05

On Tue, 18 Jun 2024 16:45:56 -0700 David Wei wrote:
quoted
quoted
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()
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help