Re: [PATCH for-next] RDMA/core: fix ENODEV error for iwarp test over vlan

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

 



Hi Anumula,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Anumula-Murali-Mohan-Reddy/RDMA-core-fix-ENODEV-error-for-iwarp-test-over-vlan/20240926-140515
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
patch link:    https://lore.kernel.org/r/20240926060708.82018-1-anumula%40chelsio.com
patch subject: [PATCH for-next] RDMA/core: fix ENODEV error for iwarp test over vlan
config: x86_64-randconfig-161-20240926 (https://download.01.org/0day-ci/archive/20240927/202409270901.6bDFVhkz-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202409270901.6bDFVhkz-lkp@xxxxxxxxx/

smatch warnings:
drivers/infiniband/core/addr.c:272 rdma_find_ndev_for_src_ip_rcu() error: we previously assumed 'dev' could be null (see line 256)

vim +/dev +272 drivers/infiniband/core/addr.c

caf1e3ae9fa648 Parav Pandit               2018-09-05  245  static struct net_device *
caf1e3ae9fa648 Parav Pandit               2018-09-05  246  rdma_find_ndev_for_src_ip_rcu(struct net *net, const struct sockaddr *src_in)
caf1e3ae9fa648 Parav Pandit               2018-09-05  247  {
caf1e3ae9fa648 Parav Pandit               2018-09-05  248  	struct net_device *dev = NULL;
caf1e3ae9fa648 Parav Pandit               2018-09-05  249  	int ret = -EADDRNOTAVAIL;
caf1e3ae9fa648 Parav Pandit               2018-09-05  250  
caf1e3ae9fa648 Parav Pandit               2018-09-05  251  	switch (src_in->sa_family) {
caf1e3ae9fa648 Parav Pandit               2018-09-05  252  	case AF_INET:
caf1e3ae9fa648 Parav Pandit               2018-09-05  253  		dev = __ip_dev_find(net,
caf1e3ae9fa648 Parav Pandit               2018-09-05  254  				    ((const struct sockaddr_in *)src_in)->sin_addr.s_addr,
caf1e3ae9fa648 Parav Pandit               2018-09-05  255  				    false);
caf1e3ae9fa648 Parav Pandit               2018-09-05 @256  		if (dev)

dev can be NULL

caf1e3ae9fa648 Parav Pandit               2018-09-05  257  			ret = 0;
caf1e3ae9fa648 Parav Pandit               2018-09-05  258  		break;
caf1e3ae9fa648 Parav Pandit               2018-09-05  259  #if IS_ENABLED(CONFIG_IPV6)
caf1e3ae9fa648 Parav Pandit               2018-09-05  260  	case AF_INET6:
caf1e3ae9fa648 Parav Pandit               2018-09-05  261  		for_each_netdev_rcu(net, dev) {
caf1e3ae9fa648 Parav Pandit               2018-09-05  262  			if (ipv6_chk_addr(net,
caf1e3ae9fa648 Parav Pandit               2018-09-05  263  					  &((const struct sockaddr_in6 *)src_in)->sin6_addr,
caf1e3ae9fa648 Parav Pandit               2018-09-05  264  					  dev, 1)) {
caf1e3ae9fa648 Parav Pandit               2018-09-05  265  				ret = 0;
caf1e3ae9fa648 Parav Pandit               2018-09-05  266  				break;
caf1e3ae9fa648 Parav Pandit               2018-09-05  267  			}
caf1e3ae9fa648 Parav Pandit               2018-09-05  268  		}
caf1e3ae9fa648 Parav Pandit               2018-09-05  269  		break;
caf1e3ae9fa648 Parav Pandit               2018-09-05  270  #endif
caf1e3ae9fa648 Parav Pandit               2018-09-05  271  	}
b1d29f42e02d0c Anumula Murali Mohan Reddy 2024-09-26 @272  	if (is_vlan_dev(dev))
                                                                                ^^^
Dereferenced inside function.

b1d29f42e02d0c Anumula Murali Mohan Reddy 2024-09-26  273  		dev = vlan_dev_real_dev(dev);
caf1e3ae9fa648 Parav Pandit               2018-09-05  274  	return ret ? ERR_PTR(ret) : dev;
caf1e3ae9fa648 Parav Pandit               2018-09-05  275  }
caf1e3ae9fa648 Parav Pandit               2018-09-05  276  

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





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux