]> www.infradead.org Git - users/hch/xfs.git/commit
net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()
authorSu Hui <suhui@nfschina.com>
Wed, 5 Jun 2024 03:47:43 +0000 (11:47 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 6 Jun 2024 11:34:33 +0000 (13:34 +0200)
commit0dcc53abf58d572d34c5313de85f607cd33fc691
treefccc039dfb5a35dbdf38fed559628a85187126aa
parentb01e1c030770ff3b4fe37fc7cc6bca03f594133f
net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()

Clang static checker (scan-build) warning:
net/ethtool/ioctl.c:line 2233, column 2
Called function pointer is null (null dereference).

Return '-EOPNOTSUPP' when 'ops->get_ethtool_phy_stats' is NULL to fix
this typo error.

Fixes: 201ed315f967 ("net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers")
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Link: https://lore.kernel.org/r/20240605034742.921751-1-suhui@nfschina.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ethtool/ioctl.c