All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error: uninitialized symbol 'err'.
Date: Wed, 5 Jan 2022 15:18:27 +0300	[thread overview]
Message-ID: <202112110349.5CNAwmu6-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c741e49150dbb0c0aebe234389f4aa8b47958fa8
commit: 0a6f17c6ae2116809a7b7eb6dd3eab59ef5460ef net: dsa: tag_ocelot_8021q: add support for PTP timestamping
config: x86_64-randconfig-m001-20211210 (https://download.01.org/0day-ci/archive/20211211/202112110349.5CNAwmu6-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

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)) {

Can this 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)
                                                            ^^^
That's what triggers the warning.

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


WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error: uninitialized symbol 'err'.
Date: Sat, 11 Dec 2021 03:45:42 +0800	[thread overview]
Message-ID: <202112110349.5CNAwmu6-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean@nxp.com>
CC: Florian Fainelli <f.fainelli@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c741e49150dbb0c0aebe234389f4aa8b47958fa8
commit: 0a6f17c6ae2116809a7b7eb6dd3eab59ef5460ef net: dsa: tag_ocelot_8021q: add support for PTP timestamping
date:   10 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 10 months ago
config: x86_64-randconfig-m001-20211210 (https://download.01.org/0day-ci/archive/20211211/202112110349.5CNAwmu6-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

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

c0bcf537667cf8 Yangbo Lu       2019-11-20  1285  
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)) {
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  }
0a6f17c6ae2116 Vladimir Oltean 2021-02-14  1334  

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error: uninitialized symbol 'err'.
Date: Wed, 05 Jan 2022 15:18:27 +0300	[thread overview]
Message-ID: <202112110349.5CNAwmu6-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c741e49150dbb0c0aebe234389f4aa8b47958fa8
commit: 0a6f17c6ae2116809a7b7eb6dd3eab59ef5460ef net: dsa: tag_ocelot_8021q: add support for PTP timestamping
config: x86_64-randconfig-m001-20211210 (https://download.01.org/0day-ci/archive/20211211/202112110349.5CNAwmu6-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

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)) {

Can this 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)
                                                            ^^^
That's what triggers the warning.

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

             reply	other threads:[~2022-01-05 12:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 19:45 kernel test robot [this message]
2022-01-05 12:18 ` drivers/net/dsa/ocelot/felix.c:1329 felix_check_xtr_pkt() error: uninitialized symbol 'err' Dan Carpenter
2022-01-05 12:18 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2021-08-16 13:59 Dan Carpenter
2021-08-16 13:56 ` kernel test robot
2021-08-16 13:59 ` Dan Carpenter
2021-05-17 13:15 Dan Carpenter
2021-05-17 12:21 ` kernel test robot
2021-05-17 13:15 ` Dan Carpenter

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=202112110349.5CNAwmu6-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=f.fainelli@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=vladimir.oltean@nxp.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 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.