Skip to contentSkip to conversation

net/mlx5e: Create advanced steering operation (ASO) object for MACsec

bug report Dan Carpenter 1 participant 1 message Oct 12, 2022 InfiniBand

lore
Share & tools
lore
#0 lore raw

Hello Emeel Hakim,

This is a semi-automatic email about new static checker warnings.

The patch 1f53da676439: "net/mlx5e: Create advanced steering operation (ASO) object for MACsec" from Sep 21, 2022, leads to the following Smatch complaint:

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c:1851 mlx5e_macsec_cleanup()
warn: variable dereferenced before check 'macsec' (see line 1849)

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
1848 struct mlx5e_macsec *macsec = priv->macsec;

  1849		struct mlx5_core_dev *mdev = macsec->mdev;
                                             ^^^^^^^^^^^^

The patch adds a dereference

1850
1851 if (!macsec)

                     ^^^^^^

But the old code assumed "macsec" could be NULL

1852 return;
1853

regards,
dan carpenter