From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Su Hui <suhui@nfschina.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<nathan@kernel.org>, <ndesaulniers@google.com>,
<morbo@google.com>, <justinstitt@google.com>
Cc: <andrew@lunn.ch>, <ahmed.zaki@intel.com>, <hkallweit1@gmail.com>,
<justin.chen@broadcom.com>, <jdamato@fastly.com>,
<gerhard@engleder-embedded.com>, <d-tatianin@yandex-team.ru>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<llvm@lists.linux.dev>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net] net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()
Date: Wed, 5 Jun 2024 06:05:07 +0200 [thread overview]
Message-ID: <6a5afc74-ecc4-4818-b425-47d843e25735@intel.com> (raw)
In-Reply-To: <20240605034742.921751-1-suhui@nfschina.com>
On 6/5/24 05:47, Su Hui wrote:
> 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>
> ---
> net/ethtool/ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 5a55270aa86e..e645d751a5e8 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -2220,7 +2220,7 @@ static int ethtool_get_phy_stats_ethtool(struct net_device *dev,
> const struct ethtool_ops *ops = dev->ethtool_ops;
> int n_stats, ret;
>
> - if (!ops || !ops->get_sset_count || ops->get_ethtool_phy_stats)
> + if (!ops || !ops->get_sset_count || !ops->get_ethtool_phy_stats)
> return -EOPNOTSUPP;
>
> n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS);
Thank you,
both the change and provided Fixes tag are correct.
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
next prev parent reply other threads:[~2024-06-05 4:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 3:47 [PATCH net] net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool() Su Hui
2024-06-05 4:05 ` Przemek Kitszel [this message]
2024-06-05 7:00 ` Hariprasad Kelam
2024-06-06 11:40 ` [PATCH net] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a5afc74-ecc4-4818-b425-47d843e25735@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=ahmed.zaki@intel.com \
--cc=andrew@lunn.ch \
--cc=d-tatianin@yandex-team.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerhard@engleder-embedded.com \
--cc=hkallweit1@gmail.com \
--cc=jdamato@fastly.com \
--cc=justin.chen@broadcom.com \
--cc=justinstitt@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=suhui@nfschina.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox