The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
@ 2020-08-31 12:35 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-08-31 12:35 UTC (permalink / raw)
  To: kbuild, Vladimir Oltean; +Cc: lkp, kbuild-all, linux-kernel, Florian Fainelli

[-- Attachment #1: Type: text/plain, Size: 3182 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4d41ead6ead97c3730bbd186a601a64828668f01
commit: 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce net: dsa: sja1105: add a new best_effort_vlan_filtering devlink parameter
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2cafa72e516f61b6d82c2416b4f5963fb48fd9ce
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce
vim +/rc +2342 drivers/net/dsa/sja1105/sja1105_main.c

2cafa72e516f61 Vladimir Oltean 2020-05-12  2316  static int sja1105_best_effort_vlan_filtering_set(struct sja1105_private *priv,
2cafa72e516f61 Vladimir Oltean 2020-05-12  2317  						  bool be_vlan)
2cafa72e516f61 Vladimir Oltean 2020-05-12  2318  {
2cafa72e516f61 Vladimir Oltean 2020-05-12  2319  	struct dsa_switch *ds = priv->ds;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2320  	bool vlan_filtering;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2321  	int port;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2322  	int rc;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2323  
2cafa72e516f61 Vladimir Oltean 2020-05-12  2324  	priv->best_effort_vlan_filtering = be_vlan;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2325  
2cafa72e516f61 Vladimir Oltean 2020-05-12  2326  	rtnl_lock();
2cafa72e516f61 Vladimir Oltean 2020-05-12  2327  	for (port = 0; port < ds->num_ports; port++) {
2cafa72e516f61 Vladimir Oltean 2020-05-12  2328  		struct dsa_port *dp;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2329  
2cafa72e516f61 Vladimir Oltean 2020-05-12  2330  		if (!dsa_is_user_port(ds, port))
2cafa72e516f61 Vladimir Oltean 2020-05-12  2331  			continue;

What if ds->num_ports is zero or they're all user ports?

2cafa72e516f61 Vladimir Oltean 2020-05-12  2332  
2cafa72e516f61 Vladimir Oltean 2020-05-12  2333  		dp = dsa_to_port(ds, port);
2cafa72e516f61 Vladimir Oltean 2020-05-12  2334  		vlan_filtering = dsa_port_is_vlan_filtering(dp);
2cafa72e516f61 Vladimir Oltean 2020-05-12  2335  
2cafa72e516f61 Vladimir Oltean 2020-05-12  2336  		rc = sja1105_vlan_filtering(ds, port, vlan_filtering);
2cafa72e516f61 Vladimir Oltean 2020-05-12  2337  		if (rc)
2cafa72e516f61 Vladimir Oltean 2020-05-12  2338  			break;
2cafa72e516f61 Vladimir Oltean 2020-05-12  2339  	}
2cafa72e516f61 Vladimir Oltean 2020-05-12  2340  	rtnl_unlock();
2cafa72e516f61 Vladimir Oltean 2020-05-12  2341  
2cafa72e516f61 Vladimir Oltean 2020-05-12 @2342  	return rc;
                                                        ^^^^^^^^^

2cafa72e516f61 Vladimir Oltean 2020-05-12  2343  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24604 bytes --]

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

only message in thread, other threads:[~2020-08-31 12:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 12:35 drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc' Dan Carpenter

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