[lvc-project] [PATCH v1 0/3] net/ethtool/ioctl: correct & simplify ethtool_get_phy_stats if checks

Daniil Tatianin d-tatianin at yandex-team.ru
Fri Nov 25 19:49:10 MSK 2022


This series fixes a potential NULL dereference in ethtool_get_phy_stats
while also attempting to refactor said function 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.

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: correct & simplify ethtool_get_phy_stats if checks

 net/ethtool/ioctl.c | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

-- 
2.25.1




More information about the lvc-project mailing list