Skip to content

Commit

Permalink
net: ethernet/mellanox: fix dereference before null check
Browse files Browse the repository at this point in the history
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@gmail.com>
  • Loading branch information
PraghadeeshTKS authored and intel-lab-lkp committed Sep 30, 2022
1 parent 10c2aba commit b435d65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b435d65

Please sign in to comment.