* [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)
@ 2023-08-04 5:20 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-08-04 5:20 UTC (permalink / raw)
To: oe-kbuild, Roi Dayan
Cc: lkp, oe-kbuild-all, Linux Memory Management List, Saeed Mahameed,
Eli Cohen, Shay Drory
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-04 5:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 5:20 [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) Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox