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: Re: [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying phy stats by index
Date: Wed, 3 Jul 2024 05:51:06 +0800	[thread overview]
Message-ID: <202407030529.aOYGI0u2-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240701131801.1227740-13-maxime.chevallier@bootlin.com>
References: <20240701131801.1227740-13-maxime.chevallier@bootlin.com>
TO: Maxime Chevallier <maxime.chevallier@bootlin.com>

Hi Maxime,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Maxime-Chevallier/net-phy-Introduce-ethernet-link-topology-representation/20240701-223116
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240701131801.1227740-13-maxime.chevallier%40bootlin.com
patch subject: [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying phy stats by index
:::::: branch date: 31 hours ago
:::::: commit date: 31 hours ago
config: i386-randconfig-141-20240703 (https://download.01.org/0day-ci/archive/20240703/202407030529.aOYGI0u2-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)

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
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202407030529.aOYGI0u2-lkp@intel.com/

smatch warnings:
net/ethtool/strset.c:295 strset_prepare_data() warn: variable dereferenced before check 'info' (see line 283)

vim +/info +295 net/ethtool/strset.c

71921690f9745fe Michal Kubecek    2019-12-27  275  
71921690f9745fe Michal Kubecek    2019-12-27  276  static int strset_prepare_data(const struct ethnl_req_info *req_base,
71921690f9745fe Michal Kubecek    2019-12-27  277  			       struct ethnl_reply_data *reply_base,
f946270d05c2604 Jakub Kicinski    2023-08-14  278  			       const struct genl_info *info)
71921690f9745fe Michal Kubecek    2019-12-27  279  {
71921690f9745fe Michal Kubecek    2019-12-27  280  	const struct strset_req_info *req_info = STRSET_REQINFO(req_base);
71921690f9745fe Michal Kubecek    2019-12-27  281  	struct strset_reply_data *data = STRSET_REPDATA(reply_base);
71921690f9745fe Michal Kubecek    2019-12-27  282  	struct net_device *dev = reply_base->dev;
a0400b1b08fea15 Maxime Chevallier 2024-07-01 @283  	struct nlattr **tb = info->attrs;
a0400b1b08fea15 Maxime Chevallier 2024-07-01  284  	struct phy_device *phydev;
71921690f9745fe Michal Kubecek    2019-12-27  285  	unsigned int i;
71921690f9745fe Michal Kubecek    2019-12-27  286  	int ret;
71921690f9745fe Michal Kubecek    2019-12-27  287  
71921690f9745fe Michal Kubecek    2019-12-27  288  	BUILD_BUG_ON(ARRAY_SIZE(info_template) != ETH_SS_COUNT);
71921690f9745fe Michal Kubecek    2019-12-27  289  	memcpy(&data->sets, &info_template, sizeof(data->sets));
71921690f9745fe Michal Kubecek    2019-12-27  290  
71921690f9745fe Michal Kubecek    2019-12-27  291  	if (!dev) {
71921690f9745fe Michal Kubecek    2019-12-27  292  		for (i = 0; i < ETH_SS_COUNT; i++) {
71921690f9745fe Michal Kubecek    2019-12-27  293  			if ((req_info->req_ids & (1U << i)) &&
71921690f9745fe Michal Kubecek    2019-12-27  294  			    data->sets[i].per_dev) {
71921690f9745fe Michal Kubecek    2019-12-27 @295  				if (info)
71921690f9745fe Michal Kubecek    2019-12-27  296  					GENL_SET_ERR_MSG(info, "requested per device strings without dev");
71921690f9745fe Michal Kubecek    2019-12-27  297  				return -EINVAL;
71921690f9745fe Michal Kubecek    2019-12-27  298  			}
71921690f9745fe Michal Kubecek    2019-12-27  299  		}
ac9c41d5a053e71 Dan Carpenter     2020-01-08  300  		return 0;
71921690f9745fe Michal Kubecek    2019-12-27  301  	}
71921690f9745fe Michal Kubecek    2019-12-27  302  
a0400b1b08fea15 Maxime Chevallier 2024-07-01  303  	phydev = ethnl_req_get_phydev(req_base, tb[ETHTOOL_A_HEADER_FLAGS],
a0400b1b08fea15 Maxime Chevallier 2024-07-01  304  				      info->extack);
a0400b1b08fea15 Maxime Chevallier 2024-07-01  305  
a0400b1b08fea15 Maxime Chevallier 2024-07-01  306  	/* phydev can be NULL, check for errors only */
a0400b1b08fea15 Maxime Chevallier 2024-07-01  307  	if (IS_ERR(phydev))
a0400b1b08fea15 Maxime Chevallier 2024-07-01  308  		return PTR_ERR(phydev);
a0400b1b08fea15 Maxime Chevallier 2024-07-01  309  
71921690f9745fe Michal Kubecek    2019-12-27  310  	ret = ethnl_ops_begin(dev);
71921690f9745fe Michal Kubecek    2019-12-27  311  	if (ret < 0)
71921690f9745fe Michal Kubecek    2019-12-27  312  		goto err_strset;
71921690f9745fe Michal Kubecek    2019-12-27  313  	for (i = 0; i < ETH_SS_COUNT; i++) {
71921690f9745fe Michal Kubecek    2019-12-27  314  		if (!strset_include(req_info, data, i) ||
71921690f9745fe Michal Kubecek    2019-12-27  315  		    !data->sets[i].per_dev)
71921690f9745fe Michal Kubecek    2019-12-27  316  			continue;
71921690f9745fe Michal Kubecek    2019-12-27  317  
a0400b1b08fea15 Maxime Chevallier 2024-07-01  318  		ret = strset_prepare_set(&data->sets[i], dev, phydev, i,
71921690f9745fe Michal Kubecek    2019-12-27  319  					 req_info->counts_only);
71921690f9745fe Michal Kubecek    2019-12-27  320  		if (ret < 0)
71921690f9745fe Michal Kubecek    2019-12-27  321  			goto err_ops;
71921690f9745fe Michal Kubecek    2019-12-27  322  	}
71921690f9745fe Michal Kubecek    2019-12-27  323  	ethnl_ops_complete(dev);
71921690f9745fe Michal Kubecek    2019-12-27  324  
71921690f9745fe Michal Kubecek    2019-12-27  325  	return 0;
71921690f9745fe Michal Kubecek    2019-12-27  326  err_ops:
71921690f9745fe Michal Kubecek    2019-12-27  327  	ethnl_ops_complete(dev);
71921690f9745fe Michal Kubecek    2019-12-27  328  err_strset:
71921690f9745fe Michal Kubecek    2019-12-27  329  	strset_cleanup_data(reply_base);
71921690f9745fe Michal Kubecek    2019-12-27  330  	return ret;
71921690f9745fe Michal Kubecek    2019-12-27  331  }
71921690f9745fe Michal Kubecek    2019-12-27  332  

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

             reply	other threads:[~2024-07-02 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02 21:51 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-01 13:17 [PATCH net-next v13 00/13] Introduce PHY listing and link_topology tracking Maxime Chevallier
2024-07-01 13:17 ` [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying phy stats by index Maxime Chevallier
2024-07-02 10:54   ` Simon Horman
2024-07-03  6:55     ` Maxime Chevallier
2024-07-03 19:12       ` Jakub Kicinski
2024-07-03 20:18       ` Simon Horman
2024-07-03  2:56   ` Dan Carpenter
2024-07-03  8:28     ` Maxime Chevallier

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=202407030529.aOYGI0u2-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.