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: 1f53da676439 ("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>
This commit is contained in:
parent
6960d133f6
commit
f812747693
@ -1846,25 +1846,16 @@ err_hash:
|
||||
void mlx5e_macsec_cleanup(struct mlx5e_priv *priv)
|
||||
{
|
||||
struct mlx5e_macsec *macsec = priv->macsec;
|
||||
struct mlx5_core_dev *mdev = macsec->mdev;
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
|
||||
if (!macsec)
|
||||
return;
|
||||
|
||||
mlx5_notifier_unregister(mdev, &macsec->nb);
|
||||
|
||||
mlx5e_macsec_fs_cleanup(macsec->macsec_fs);
|
||||
|
||||
/* Cleanup workqueue */
|
||||
destroy_workqueue(macsec->wq);
|
||||
|
||||
mlx5e_macsec_aso_cleanup(&macsec->aso, mdev);
|
||||
|
||||
priv->macsec = NULL;
|
||||
|
||||
rhashtable_destroy(&macsec->sci_hash);
|
||||
|
||||
mutex_destroy(&macsec->lock);
|
||||
|
||||
kfree(macsec);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user