[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202301112113.yIJVocGy-lkp@intel.com>
Date: Wed, 11 Jan 2023 21:49:07 +0800
From: kernel test robot <lkp@...el.com>
To: ehakim@...dia.com, netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
raeds@...dia.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, sd@...asysnail.net,
atenart@...nel.org, Emeel Hakim <ehakim@...dia.com>
Subject: Re: [PATCH net-next v8 1/2] macsec: add support for
IFLA_MACSEC_OFFLOAD in macsec_changelink
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/ehakim-nvidia-com/macsec-add-support-for-IFLA_MACSEC_OFFLOAD-in-macsec_changelink/20230111-161338
patch link: https://lore.kernel.org/r/20230111081112.21067-2-ehakim%40nvidia.com
patch subject: [PATCH net-next v8 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink
config: i386-randconfig-a004
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/c93acd54f94e1c0ed9e310ab25c9aa6ea95c7c8a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review ehakim-nvidia-com/macsec-add-support-for-IFLA_MACSEC_OFFLOAD-in-macsec_changelink/20230111-161338
git checkout c93acd54f94e1c0ed9e310ab25c9aa6ea95c7c8a
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/net/macsec.c:2666:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (macsec->offload != offload)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/macsec.c:2670:9: note: uninitialized use occurs here
return ret;
^~~
drivers/net/macsec.c:2666:2: note: remove the 'if' if its condition is always true
if (macsec->offload != offload)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/macsec.c:2637:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +2666 drivers/net/macsec.c
2629
2630 static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info)
2631 {
2632 struct nlattr *tb_offload[MACSEC_OFFLOAD_ATTR_MAX + 1];
2633 struct nlattr **attrs = info->attrs;
2634 enum macsec_offload offload;
2635 struct macsec_dev *macsec;
2636 struct net_device *dev;
2637 int ret;
2638
2639 if (!attrs[MACSEC_ATTR_IFINDEX])
2640 return -EINVAL;
2641
2642 if (!attrs[MACSEC_ATTR_OFFLOAD])
2643 return -EINVAL;
2644
2645 if (nla_parse_nested_deprecated(tb_offload, MACSEC_OFFLOAD_ATTR_MAX,
2646 attrs[MACSEC_ATTR_OFFLOAD],
2647 macsec_genl_offload_policy, NULL))
2648 return -EINVAL;
2649
2650 rtnl_lock();
2651
2652 dev = get_dev_from_nl(genl_info_net(info), attrs);
2653 if (IS_ERR(dev)) {
2654 ret = PTR_ERR(dev);
2655 goto out;
2656 }
2657 macsec = macsec_priv(dev);
2658
2659 if (!tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]) {
2660 ret = -EINVAL;
2661 goto out;
2662 }
2663
2664 offload = nla_get_u8(tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]);
2665
> 2666 if (macsec->offload != offload)
2667 ret = macsec_update_offload(dev, offload);
2668 out:
2669 rtnl_unlock();
2670 return ret;
2671 }
2672
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
View attachment "config" of type "text/plain" (131399 bytes)
Powered by blists - more mailing lists