linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Roi Dayan <roid@nvidia.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Saeed Mahameed <saeedm@nvidia.com>, Eli Cohen <elic@nvidia.com>,
	Shay Drory <shayd@nvidia.com>
Subject: [linux-next:master 4511/6910] drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c:264 mlx5_devcom_send_event() warn: variable dereferenced before IS_ERR check 'devcom' (see line 259)
Date: Fri, 4 Aug 2023 08:20:04 +0300	[thread overview]
Message-ID: <a181425f-6c87-4813-a703-dddca235454a@kadam.mountain> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   fb4327106e5250ee360d0d8b056c1eef7eeb9a98
commit: 88d162b479815f5d6b6a4ff5fdb07aec9dc6280c [4511/6910] net/mlx5: Devcom, Infrastructure changes
config: x86_64-randconfig-m001-20230803 (https://download.01.org/0day-ci/archive/20230804/202308041028.AkXYDwJ6-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230804/202308041028.AkXYDwJ6-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@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202308041028.AkXYDwJ6-lkp@intel.com/

smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c:264 mlx5_devcom_send_event() warn: variable dereferenced before IS_ERR check 'devcom' (see line 259)

vim +/devcom +264 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c

88d162b479815f Roi Dayan   2023-05-04  255  int mlx5_devcom_send_event(struct mlx5_devcom_comp_dev *devcom,
e2a82bf8a42816 Shay Drory  2023-02-06  256  			   int event, int rollback_event,
fadd59fc50d010 Aviv Heller 2018-12-04  257  			   void *event_data)
fadd59fc50d010 Aviv Heller 2018-12-04  258  {
88d162b479815f Roi Dayan   2023-05-04 @259  	struct mlx5_devcom_comp *comp = devcom->comp;
                                                                                ^^^^^^^^^^^^
Dereference

88d162b479815f Roi Dayan   2023-05-04  260  	struct mlx5_devcom_comp_dev *pos;
88d162b479815f Roi Dayan   2023-05-04  261  	int err = 0;
88d162b479815f Roi Dayan   2023-05-04  262  	void *data;
fadd59fc50d010 Aviv Heller 2018-12-04  263  
fadd59fc50d010 Aviv Heller 2018-12-04 @264  	if (IS_ERR_OR_NULL(devcom))
                                                                   ^^^^^^
Checked too late

88d162b479815f Roi Dayan   2023-05-04  265  		return -ENODEV;
fadd59fc50d010 Aviv Heller 2018-12-04  266  
fadd59fc50d010 Aviv Heller 2018-12-04  267  	down_write(&comp->sem);

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



                 reply	other threads:[~2023-08-04  5:20 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=a181425f-6c87-4813-a703-dddca235454a@kadam.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=elic@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.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