[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210119090836.GK2696@kadam>
Date: Tue, 19 Jan 2021 12:08:36 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Parav Pandit <parav@...lanox.com>
Cc: lkp@...el.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, Saeed Mahameed <saeedm@...lanox.com>,
Moshe Shemesh <moshe@...lanox.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/main.c:1187 mlx5_load_one()
warn: missing error code 'err'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e2da783614bb8930aa89753d3c3cd53d5604665d
commit: 4162f58b476b248d0718f3d6aad2e57da2b08a63 net/mlx5: Have single error unwinding path
config: i386-randconfig-m021-20210118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/main.c:1187 mlx5_load_one() warn: missing error code 'err'
vim +/err +1187 drivers/net/ethernet/mellanox/mlx5/core/main.c
4383cfcc65e7879e Michael Guralnik 2019-10-27 1180 int mlx5_load_one(struct mlx5_core_dev *dev, bool boot)
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1181 {
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1182 int err = 0;
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1183
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1184 mutex_lock(&dev->intf_state_mutex);
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1185 if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1186 mlx5_core_warn(dev, "interface is up, NOP\n");
Why are we printing a warning on a success path?
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 @1187 goto out;
1bde6e301cf6217d Eli Cohen 2014-01-14 1188 }
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1189 /* remove any previous indication of internal error */
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1190 dev->state = MLX5_DEVICE_STATE_UP;
e126ba97dba9edeb Eli Cohen 2013-07-07 1191
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1192 err = mlx5_function_setup(dev, boot);
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1193 if (err)
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1194 goto out;
e126ba97dba9edeb Eli Cohen 2013-07-07 1195
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1196 if (boot) {
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1197 err = mlx5_init_once(dev);
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1198 if (err) {
98a8e6fc482d9680 Huy Nguyen 2019-03-29 1199 mlx5_core_err(dev, "sw objs init failed\n");
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1200 goto function_teardown;
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1201 }
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1202 }
cd23b14b654769db Eli Cohen 2013-07-18 1203
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1204 err = mlx5_load(dev);
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1205 if (err)
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1206 goto err_load;
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1207
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1208 if (boot) {
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1209 err = mlx5_devlink_register(priv_to_devlink(dev), dev->device);
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1210 if (err)
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1211 goto err_devlink_reg;
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1212 }
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1213
ecd01db8711d4c60 Parav Pandit 2020-03-08 1214 if (mlx5_device_registered(dev))
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1215 mlx5_attach_device(dev);
ecd01db8711d4c60 Parav Pandit 2020-03-08 1216 else
ecd01db8711d4c60 Parav Pandit 2020-03-08 1217 mlx5_register_device(dev);
e126ba97dba9edeb Eli Cohen 2013-07-07 1218
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1219 set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
e126ba97dba9edeb Eli Cohen 2013-07-07 1220
4162f58b476b248d Parav Pandit 2020-05-01 1221 mutex_unlock(&dev->intf_state_mutex);
4162f58b476b248d Parav Pandit 2020-05-01 1222 return 0;
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1223
a6f3b62386a02c1e Michael Guralnik 2019-11-20 1224 err_devlink_reg:
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1225 mlx5_unload(dev);
a80d1b68c8b7a06b Saeed Mahameed 2019-03-29 1226 err_load:
59211bd3b6329c3e Mohamad Haj Yahia 2016-09-09 1227 if (boot)
59211bd3b6329c3e Mohamad Haj Yahia 2016-09-09 1228 mlx5_cleanup_once(dev);
e161105e58da81fa Saeed Mahameed 2019-03-29 1229 function_teardown:
e161105e58da81fa Saeed Mahameed 2019-03-29 1230 mlx5_function_teardown(dev, boot);
89d44f0a6c732db2 Majd Dibbiny 2015-10-14 1231 dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
4162f58b476b248d Parav Pandit 2020-05-01 1232 out:
89d44f0a6c732db2 Majd Dibbiny 2015-10-14 1233 mutex_unlock(&dev->intf_state_mutex);
e126ba97dba9edeb Eli Cohen 2013-07-07 1234 return err;
e126ba97dba9edeb Eli Cohen 2013-07-07 1235 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (38957 bytes)
Powered by blists - more mailing lists