Thread (19 messages) 19 messages, 3 authors, 2024-07-03

Re: [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying phy stats by index

From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-07-03 19:12:39
Also in: lkml, netdev

On Wed, 3 Jul 2024 08:55:15 +0200 Maxime Chevallier wrote:
quoted
Elsewhere in this function it is assumed that info may be NULL.
But here it is dereferenced unconditionally.  
Hmm in almst all netlink commands we do dereference the genl_info *info
pointer without checks.

I've looked into net/netlink/genetlink.c to backtrack call-sites and it
looks to be that indeed info can't be NULL (either populated from
genl_start() or genl_family_rcv_msg_doit(). Maybe Jakub can confirm
this ?

If what I say above is correct, I can include a small patch to remove
the un-necessary check that makes smatch think the genl_info pointer can
be NULL.
The info used to be null during dumps, but I think we fixed that in
f946270d05c2 ("ethtool: netlink: always pass genl_info to .prepare_data")
Perhaps I should have cleaned up existing code :S
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help