All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers
@ 2022-12-26 11:48 Daniil Tatianin
  2022-12-26 11:48 ` [PATCH net v2 1/3] net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats Daniil Tatianin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Daniil Tatianin @ 2022-12-26 11:48 UTC (permalink / raw)
  To: David S. Miller
  Cc: Daniil Tatianin, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Sean Anderson, Jiri Pirko, Wolfram Sang,
	Maxim Korotkov, Gal Pressman, Vincent Mailhol, Tom Rix,
	Marco Bonelli, netdev, linux-kernel

This series fixes a potential NULL dereference in ethtool_get_phy_stats
while also attempting to refactor/split said function into multiple
helpers so that it's easier to reason about what's going on.

I've taken Andrew Lunn's suggestions on the previous version of this
patch and added a bit of my own.

Changes since v1:
- Remove an extra newline in the first patch
- Move WARN_ON_ONCE into the if check as it already returns the
  result of the comparison 
- Actually split ethtool_get_phy_stats instead of attempting to
  refactor it

Daniil Tatianin (3):
  net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats
  net/ethtool/ioctl: remove if n_stats checks from ethtool_get_phy_stats
  net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers

 net/ethtool/ioctl.c | 107 +++++++++++++++++++++++++++++---------------
 1 file changed, 70 insertions(+), 37 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-28 12:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-26 11:48 [PATCH net v2 0/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers Daniil Tatianin
2022-12-26 11:48 ` [PATCH net v2 1/3] net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats Daniil Tatianin
2022-12-26 11:48 ` [PATCH net v2 2/3] net/ethtool/ioctl: remove if n_stats checks from ethtool_get_phy_stats Daniil Tatianin
2022-12-26 11:48 ` [PATCH net v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers Daniil Tatianin
2022-12-28 12:00 ` [PATCH net v2 0/3] " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.