All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: net/ethtool/mse.c:285 mse_fill_reply() warn: missing unwind goto?
Date: Sun, 24 May 2026 16:26:05 +0800	[thread overview]
Message-ID: <202605241642.RFiYcaVG-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Oleksij Rempel <o.rempel@pengutronix.de>
CC: Jakub Kicinski <kuba@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4cbfe4502e3d4bda48eb4b83dfad8d7da3b22e90
commit: e6e93fb01302e9b7a15d17f3b8a00eff8a601654 ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access
date:   7 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 7 months ago
config: x86_64-randconfig-161-20260523 (https://download.01.org/0day-ci/archive/20260524/202605241642.RFiYcaVG-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: e6e93fb01302 ("ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202605241642.RFiYcaVG-lkp@intel.com/

smatch warnings:
net/ethtool/mse.c:285 mse_fill_reply() warn: missing unwind goto?

vim +285 net/ethtool/mse.c

e6e93fb01302e9 Oleksij Rempel 2025-10-27  233  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  234  static int mse_fill_reply(struct sk_buff *skb,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  235  			  const struct ethnl_req_info *req_base,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  236  			  const struct ethnl_reply_data *reply_base)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  237  {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  238  	const struct mse_reply_data *data = mse_repdata(reply_base);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  239  	struct nlattr *nest;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  240  	unsigned int i;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  241  	int ret;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  242  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  243  	nest = nla_nest_start(skb, ETHTOOL_A_MSE_CAPABILITIES);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  244  	if (!nest)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  245  		return -EMSGSIZE;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  246  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  247  	if (data->capability.supported_caps & PHY_MSE_CAP_AVG) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  248  		ret = nla_put_uint(skb,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  249  				   ETHTOOL_A_MSE_CAPABILITIES_MAX_AVERAGE_MSE,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  250  				   data->capability.max_average_mse);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  251  		if (ret < 0)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  252  			goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  253  	}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  254  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  255  	if (data->capability.supported_caps & (PHY_MSE_CAP_PEAK |
e6e93fb01302e9 Oleksij Rempel 2025-10-27  256  					       PHY_MSE_CAP_WORST_PEAK)) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  257  		ret = nla_put_uint(skb, ETHTOOL_A_MSE_CAPABILITIES_MAX_PEAK_MSE,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  258  				   data->capability.max_peak_mse);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  259  		if (ret < 0)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  260  			goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  261  	}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  262  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  263  	ret = nla_put_uint(skb, ETHTOOL_A_MSE_CAPABILITIES_REFRESH_RATE_PS,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  264  			   data->capability.refresh_rate_ps);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  265  	if (ret < 0)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  266  		goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  267  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  268  	ret = nla_put_uint(skb, ETHTOOL_A_MSE_CAPABILITIES_NUM_SYMBOLS,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  269  			   data->capability.num_symbols);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  270  	if (ret < 0)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  271  		goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  272  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  273  	nla_nest_end(skb, nest);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  274  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  275  	for (i = 0; i < data->num_snapshots; i++) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  276  		const struct mse_snapshot_entry *s = &data->snapshots[i];
e6e93fb01302e9 Oleksij Rempel 2025-10-27  277  		int chan_attr;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  278  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  279  		chan_attr = mse_channel_to_attr(s->channel);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  280  		if (chan_attr < 0)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  281  			return chan_attr;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  282  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  283  		nest = nla_nest_start(skb, chan_attr);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  284  		if (!nest)
e6e93fb01302e9 Oleksij Rempel 2025-10-27 @285  			return -EMSGSIZE;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  286  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  287  		if (data->capability.supported_caps & PHY_MSE_CAP_AVG) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  288  			ret = nla_put_uint(skb,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  289  					   ETHTOOL_A_MSE_SNAPSHOT_AVERAGE_MSE,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  290  					   s->snapshot.average_mse);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  291  			if (ret)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  292  				goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  293  		}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  294  		if (data->capability.supported_caps & PHY_MSE_CAP_PEAK) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  295  			ret = nla_put_uint(skb, ETHTOOL_A_MSE_SNAPSHOT_PEAK_MSE,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  296  					   s->snapshot.peak_mse);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  297  			if (ret)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  298  				goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  299  		}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  300  		if (data->capability.supported_caps & PHY_MSE_CAP_WORST_PEAK) {
e6e93fb01302e9 Oleksij Rempel 2025-10-27  301  			ret = nla_put_uint(skb,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  302  					   ETHTOOL_A_MSE_SNAPSHOT_WORST_PEAK_MSE,
e6e93fb01302e9 Oleksij Rempel 2025-10-27  303  					   s->snapshot.worst_peak_mse);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  304  			if (ret)
e6e93fb01302e9 Oleksij Rempel 2025-10-27  305  				goto nla_put_nest_failure;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  306  		}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  307  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  308  		nla_nest_end(skb, nest);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  309  	}
e6e93fb01302e9 Oleksij Rempel 2025-10-27  310  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  311  	return 0;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  312  
e6e93fb01302e9 Oleksij Rempel 2025-10-27  313  nla_put_nest_failure:
e6e93fb01302e9 Oleksij Rempel 2025-10-27  314  	nla_nest_cancel(skb, nest);
e6e93fb01302e9 Oleksij Rempel 2025-10-27  315  	return ret;
e6e93fb01302e9 Oleksij Rempel 2025-10-27  316  }
e6e93fb01302e9 Oleksij Rempel 2025-10-27  317  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-05-24  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24  8:26 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-25  7:04 net/ethtool/mse.c:285 mse_fill_reply() warn: missing unwind goto? kernel test robot
2026-02-09 15:26 kernel test robot

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=202605241642.RFiYcaVG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.