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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 20 Dec 2023 20:58:42 +0800
From: kernel test robot <lkp@...el.com>
To: David Wei <dw@...idwei.uk>, Jakub Kicinski <kuba@...nel.org>,
	Jiri Pirko <jiri@...nulli.us>, Sabrina Dubroca <sd@...asysnail.net>,
	netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v4 2/5] netdevsim: allow two netdevsim ports to
 be connected

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Wei/netdevsim-maintain-a-list-of-probed-netdevsims/20231220-095238
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231220014747.1508581-3-dw%40davidwei.uk
patch subject: [PATCH net-next v4 2/5] netdevsim: allow two netdevsim ports to be connected
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20231220/202312202036.QxZ1fdee-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 10056c821a56a19cef732129e4e0c5883ae1ee49)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231220/202312202036.QxZ1fdee-lkp@intel.com/reproduce)

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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312202036.QxZ1fdee-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/netdevsim/dev.c:431:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     431 |         if (!peer)
         |             ^~~~~
   drivers/net/netdevsim/dev.c:443:9: note: uninitialized use occurs here
     443 |         return ret;
         |                ^~~
   drivers/net/netdevsim/dev.c:431:2: note: remove the 'if' if its condition is always false
     431 |         if (!peer)
         |         ^~~~~~~~~~
     432 |                 goto out;
         |                 ~~~~~~~~
   drivers/net/netdevsim/dev.c:425:13: note: initialize the variable 'ret' to silence this warning
     425 |         ssize_t ret;
         |                    ^
         |                     = 0
   1 warning generated.


vim +431 drivers/net/netdevsim/dev.c

   417	
   418	static ssize_t nsim_dev_peer_read(struct file *file, char __user *data,
   419					  size_t count, loff_t *ppos)
   420	{
   421		struct nsim_dev_port *nsim_dev_port;
   422		struct netdevsim *peer;
   423		unsigned int id, port;
   424		char buf[23];
   425		ssize_t ret;
   426	
   427		mutex_lock(&nsim_dev_list_lock);
   428		rtnl_lock();
   429		nsim_dev_port = file->private_data;
   430		peer = rtnl_dereference(nsim_dev_port->ns->peer);
 > 431		if (!peer)
   432			goto out;
   433	
   434		id = peer->nsim_bus_dev->dev.id;
   435		port = peer->nsim_dev_port->port_index;
   436		ret = scnprintf(buf, sizeof(buf), "%u %u\n", id, port);
   437		ret = simple_read_from_buffer(data, count, ppos, buf, ret);
   438	
   439	out:
   440		rtnl_unlock();
   441		mutex_unlock(&nsim_dev_list_lock);
   442	
   443		return ret;
   444	}
   445	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ