public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] net/ethtool/ioctl: ensure that we have phy ops before using them
       [not found] <20221121140556.41763-1-d-tatianin@yandex-team.ru>
@ 2022-11-22  4:29 ` Jakub Kicinski
  0 siblings, 0 replies; only message in thread
From: Jakub Kicinski @ 2022-11-22  4:29 UTC (permalink / raw)
  To: Daniil Tatianin
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Hao Chen,
	Guangbin Huang, Tom Rix, Julian Wiedmann, Marco Bonelli,
	Wolfram Sang, netdev, linux-kernel, lvc-project, yc-core

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@kernel.org>
> Signed-off-by: Daniil Tatianin <d-tatianin@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?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-22  4:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20221121140556.41763-1-d-tatianin@yandex-team.ru>
2022-11-22  4:29 ` [PATCH v2] net/ethtool/ioctl: ensure that we have phy ops before using them Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox