On Fri, Sep 30, 2022 at 05:13:35PM +0530, Praghadeesh T K S wrote: > net: ethernet/mellanox: fix dereference before null check > macsec dereferenced before null check > bug identified by coverity's linux-next weekly scan > Coverity CID No: 1525317 > > Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@xxxxxxxxx> > --- > drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c > index 5da746d..e822c2a 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c > @@ -1846,11 +1846,11 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv) > void mlx5e_macsec_cleanup(struct mlx5e_priv *priv) > { > struct mlx5e_macsec *macsec = priv->macsec; > - struct mlx5_core_dev *mdev = macsec->mdev; > > if (!macsec) > return; > > + struct mlx5_core_dev *mdev = macsec->mdev; > mlx5_notifier_unregister(mdev, &macsec->nb); > > mlx5e_macsec_fs_cleanup(macsec->macsec_fs); Always test-build your changes before you get a grumpy maintainer asking why you didn't test-build your changes... Also, the original code is just fine, Coverity is wrong here, don't you think? Look at the output of what the code is doing please... thanks, greg k-h