When calling device close, unset dek is called which destroys a hash list.
In case of error during dev probe, close is called when dek hlist is not
initialized.
Ensure non null list destroy.
Fixes: 90646d6c6e22 ("crypto/mlx5: support basic operations")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
void
mlx5_crypto_dek_unset(struct mlx5_crypto_priv *priv)
{
- mlx5_hlist_destroy(priv->dek_hlist);
- priv->dek_hlist = NULL;
+ if (priv->dek_hlist) {
+ mlx5_hlist_destroy(priv->dek_hlist);
+ priv->dek_hlist = NULL;
+ }
}