lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 16 Aug 2021 16:59:28 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Vladimir Oltean <vladimir.oltean@....com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Florian Fainelli <f.fainelli@...il.com>
Subject: drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error:
 uninitialized symbol 'err'.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7c60610d476766e128cc4284bb6349732cbd6606
commit: 0a6f17c6ae2116809a7b7eb6dd3eab59ef5460ef net: dsa: tag_ocelot_8021q: add support for PTP timestamping
config: ia64-randconfig-m031-20210816 (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.0

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

smatch warnings:
drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error: uninitialized symbol 'err'.

vim +/err +1329 drivers/net/dsa/ocelot/felix.c

0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1286  static bool felix_check_xtr_pkt(struct ocelot *ocelot, unsigned int ptp_type)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1287  {
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1288  	struct felix *felix = ocelot_to_felix(ocelot);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1289  	int err, grp = 0;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1290  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1291  	if (felix->tag_proto != DSA_TAG_PROTO_OCELOT_8021Q)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1292  		return false;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1293  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1294  	if (!felix->info->quirk_no_xtr_irq)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1295  		return false;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1296  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1297  	if (ptp_type == PTP_CLASS_NONE)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1298  		return false;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1299  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1300  	while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp)) {

Smatch is complaining that this condition could be false on the first
iteration through the loop.

0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1301  		struct sk_buff *skb;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1302  		unsigned int type;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1303  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1304  		err = ocelot_xtr_poll_frame(ocelot, grp, &skb);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1305  		if (err)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1306  			goto out;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1307  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1308  		/* We trap to the CPU port module all PTP frames, but
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1309  		 * felix_rxtstamp() only gets called for event frames.
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1310  		 * So we need to avoid sending duplicate general
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1311  		 * message frames by running a second BPF classifier
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1312  		 * here and dropping those.
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1313  		 */
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1314  		__skb_push(skb, ETH_HLEN);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1315  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1316  		type = ptp_classify_raw(skb);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1317  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1318  		__skb_pull(skb, ETH_HLEN);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1319  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1320  		if (type == PTP_CLASS_NONE) {
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1321  			kfree_skb(skb);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1322  			continue;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1323  		}
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1324  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1325  		netif_rx(skb);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1326  	}
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1327  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1328  out:
0a6f17c6ae2116 Vladimir Oltean 2021-02-14 @1329  	if (err < 0)
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1330  		ocelot_drain_cpu_queue(ocelot, 0);
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1331  
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1332  	return true;
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1333  }

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ