Skip to content

Commit f812747

Browse files
rleondavem330
authored andcommitted
net/mlx5e: Cleanup MACsec uninitialization routine
The mlx5e_macsec_cleanup() routine has NULL pointer dereferencing if mlx5 device doesn't support MACsec (priv->macsec will be NULL). While at it delete comment line, assignment and extra blank lines, so fix everything in one patch. Fixes: 1f53da6 ("net/mlx5e: Create advanced steering operation (ASO) object for MACsec") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6960d13 commit f812747

File tree

1 file changed

+1
-10
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+1
-10
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,25 +1846,16 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv)
18461846
void mlx5e_macsec_cleanup(struct mlx5e_priv *priv)
18471847
{
18481848
struct mlx5e_macsec *macsec = priv->macsec;
1849-
struct mlx5_core_dev *mdev = macsec->mdev;
1849+
struct mlx5_core_dev *mdev = priv->mdev;
18501850

18511851
if (!macsec)
18521852
return;
18531853

18541854
mlx5_notifier_unregister(mdev, &macsec->nb);
1855-
18561855
mlx5e_macsec_fs_cleanup(macsec->macsec_fs);
1857-
1858-
/* Cleanup workqueue */
18591856
destroy_workqueue(macsec->wq);
1860-
18611857
mlx5e_macsec_aso_cleanup(&macsec->aso, mdev);
1862-
1863-
priv->macsec = NULL;
1864-
18651858
rhashtable_destroy(&macsec->sci_hash);
1866-
18671859
mutex_destroy(&macsec->lock);
1868-
18691860
kfree(macsec);
18701861
}

0 commit comments

Comments
 (0)