mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Parav Pandit <parav@mellanox.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Saeed Mahameed <saeedm@mellanox.com>,
	Moshe Shemesh <moshe@mellanox.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/main.c:1187 mlx5_load_one() warn: missing error code 'err'
Date: Tue, 19 Jan 2021 12:08:36 +0300	[thread overview]
Message-ID: <20210119090836.GK2696@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 4946 bytes --]

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38957 bytes --]

                 reply	other threads:[~2021-01-19  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210119090836.GK2696@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=moshe@mellanox.com \
    --cc=parav@mellanox.com \
    --cc=saeedm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®