drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:1087:28: warning: 'tracker' is used uninitialized

kernel test robot
2023-03-09T08:31:38Z

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6a98c9cae232800c319ed69e1063480d31430887
commit: 41596803302d83a67a80dc1efef4e51ac46acabb LoongArch: Make -mstrict-align configurable
date: 12 days ago
config: loongarch-randconfig-r033-20230309 (https://download.01.org/0day-ci/archive/20230309/202303091658.YVmA2chk-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.1.0
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=41596803302d83a67a80dc1efef4e51ac46acabb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 41596803302d83a67a80dc1efef4e51ac46acabb
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303091658.YVmA2chk-lkp@intel.com/

All warnings (new ones prefixed by >>):

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c: In function 'mlx5_lag_netdev_event':
>> drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:1087:28: warning: 'tracker' is used uninitialized [-Wuninitialized]
1087 | struct lag_tracker tracker;
| ^~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:1087:28: note: 'tracker' declared here
1087 | struct lag_tracker tracker;
| ^~~~~~~

vim +/tracker +1087 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c

54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1081
94db3317781922 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Eli Cohen 2022-01-31 1082 /* this handler is always registered to netdev events */
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1083 static int mlx5_lag_netdev_event(struct notifier_block *this,
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1084 unsigned long event, void *ptr)
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1085 {
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1086 struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 @1087 struct lag_tracker tracker;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1088 struct mlx5_lag *ldev;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1089 int changed = 0;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1090
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1091 if (event != NETDEV_CHANGEUPPER &&
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1092 event != NETDEV_CHANGELOWERSTATE &&
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1093 event != NETDEV_CHANGEINFODATA)
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1094 return NOTIFY_DONE;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1095
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1096 ldev = container_of(this, struct mlx5_lag, nb);
9b412cc35f0025 drivers/net/ethernet/mellanox/mlx5/core/lag.c Jianbo Liu 2020-04-17 1097
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1098 tracker = ldev->tracker;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1099
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1100 switch (event) {
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1101 case NETDEV_CHANGEUPPER:
a4a9c87ebb689c drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Eli Cohen 2022-02-06 1102 changed = mlx5_handle_changeupper_event(ldev, &tracker, ptr);
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1103 break;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1104 case NETDEV_CHANGELOWERSTATE:
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1105 changed = mlx5_handle_changelowerstate_event(ldev, &tracker,
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1106 ndev, ptr);
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1107 break;
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1108 case NETDEV_CHANGEINFODATA:
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1109 changed = mlx5_handle_changeinfodata_event(ldev, &tracker, ndev);
54493a08e21f46 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c Mark Bloch 2022-01-12 1110 break;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1111 }
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1112
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1113 ldev->tracker = tracker;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1114
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1115 if (changed)
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1116 mlx5_queue_bond_work(ldev, 0);
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1117
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1118 return NOTIFY_DONE;
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1119 }
7907f23adc1867 drivers/net/ethernet/mellanox/mlx5/core/lag.c Aviv Heller 2016-04-17 1120

:::::: The code at line 1087 was first introduced by commit
:::::: 7907f23adc186700efbe56c032527e47485c86ab net/mlx5: Implement RoCE LAG feature

:::::: TO: Aviv Heller <avivh@mellanox.com>
:::::: CC: Leon Romanovsky <leon@kernel.org>

--
0-DAY CI Kernel Test Service