Commit 6c5e0b25 authored by Emeel Hakim's avatar Emeel Hakim Committed by Jakub Kicinski

net/mlx5e: Fix MACsec initialization error path

Currently MACsec initialization error path does not
destroy sci hash table in case of failure.
Fix by destroying hash table in case of failure.

Fixes: 9515978e ("net/mlx5e: Implement MACsec Tx data path using MACsec skb_metadata_dst")
Signed-off-by: default avatarEmeel Hakim <ehakim@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 21803630
......@@ -1285,7 +1285,7 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv)
if (err) {
mlx5_core_err(mdev, "MACsec offload: Failed to init SCI hash table, err=%d\n",
err);
goto err_out;
goto err_hash;
}
xa_init_flags(&macsec->sc_xarray, XA_FLAGS_ALLOC1);
......@@ -1307,6 +1307,8 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv)
return 0;
err_out:
rhashtable_destroy(&macsec->sci_hash);
err_hash:
mlx5_core_dealloc_pd(priv->mdev, macsec->aso_pdn);
err_pd:
kfree(macsec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment