[linux-next:master 4175/4668] net/dsa/tag_sja1105.c:564 sja1110_rcv() error: uninitialized symbol 'vid'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8d4b477da1a807199ca60e0829357ce7aa6758d5
commit: 04a1758348a87eb73b8a4554d0c227831e2bb33e [4175/4668] net: dsa: tag_sja1105: fix control packets on SJA1110 being received on an imprecise port
config: i386-randconfig-m021-20210730 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0

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

smatch warnings:
net/dsa/tag_sja1105.c:564 sja1110_rcv() error: uninitialized symbol 'vid'.

vim +/vid +564 net/dsa/tag_sja1105.c

4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  543  static struct sk_buff *sja1110_rcv(struct sk_buff *skb,
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  544  				   struct net_device *netdev,
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  545  				   struct packet_type *pt)
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  546  {
0fac6aa098edf9 Vladimir Oltean 2021-07-19  547  	int source_port = -1, switch_id = -1;
884be12f85666c Vladimir Oltean 2021-07-26  548  	u16 vid;
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  549  
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  550  	skb->offload_fwd_mark = 1;
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  551  
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  552  	if (sja1110_skb_has_inband_control_extension(skb)) {
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  553  		skb = sja1110_rcv_inband_control_extension(skb, &source_port,
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  554  							   &switch_id);
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  555  		if (!skb)
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  556  			return NULL;
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  557  	}
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  558  
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  559  	/* Packets with in-band control extensions might still have RX VLANs */
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  560  	if (likely(sja1105_skb_has_tag_8021q(skb)))
04a1758348a87e Vladimir Oltean 2021-07-29  561  		sja1105_vlan_rcv(skb, &source_port, &switch_id, &vid);

Not initialized on else path.

4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  562  
04a1758348a87e Vladimir Oltean 2021-07-29  563  	if (source_port == -1 || switch_id == -1)
884be12f85666c Vladimir Oltean 2021-07-26 @564  		skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid);
                                                                                                                          ^^^

884be12f85666c Vladimir Oltean 2021-07-26  565  	else
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  566  		skb->dev = dsa_master_find_slave(netdev, switch_id, source_port);
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  567  	if (!skb->dev) {
884be12f85666c Vladimir Oltean 2021-07-26  568  		netdev_warn(netdev, "Couldn't decode source port\n");
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  569  		return NULL;
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  570  	}
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  571  
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  572  	return skb;
4913b8ebf8a9c5 Vladimir Oltean 2021-06-11  573  }

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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux