[lvc-project] [PATCH v2] net/ethtool/ioctl: ensure that we have phy ops before using them
Jakub Kicinski
kuba at kernel.org
Tue Nov 22 07:29:44 MSK 2022
On Mon, 21 Nov 2022 17:05:56 +0300 Daniil Tatianin wrote:
> ops->get_ethtool_phy_stats was getting called in an else branch
> of ethtool_get_phy_stats() unconditionally without making sure
> it was actually present.
>
> Refactor the checks to avoid unnecessary nesting and make them more
> readable. Add an extra WARN_ON_ONCE(1) to emit a warning when a driver
> declares that it has phy stats without a way to retrieve them.
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE
> static analysis tool.
>
> Suggested-by: Jakub Kicinski <kuba at kernel.org>
> Signed-off-by: Daniil Tatianin <d-tatianin at yandex-team.ru>
Didn't make it to the list again :S Maybe try stripping the To/CC to
just netdev@, Andrew Lunn and Michal Kubecek?
More information about the lvc-project
mailing list