crypto/mlx5: fix crypto dev leak
PATCH 1/1 crypto/mlx5: fix crypto dev leak
For the case crypto initialize failed, the allocated crypto dev should be destroyed, otherwise the dev leaked. Current PMD returns directly instead of releasing the dev.
This commit fixes the crypto dev leak when initialize failed.
Fixes a27f6a2e1f30 ("crypto/mlx5: split AES-XTS")
Signed-off-by Suanming Mou <[email protected]>
Acked-by Matan Azrad <[email protected]>
--- drivers/crypto/mlx5/mlx5_crypto.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/crypto/mlx5/mlx5_crypto.c +2 -0
@@ -383,12 +383,14 @@ mlx5_crypto_dev_probe(struct mlx5_common_device *cdev,if (devarg_prms.is_aes_gcm) { ret =mlx5_crypto_gcm_init (priv);if (ret) { +rte_cryptodev_pmd_destroy (priv->crypto_dev);DRV_LOG (ERR ,"Failed to init AES-GCM crypto." );return -ENOTSUP ; } }else { ret =mlx5_crypto_xts_init (priv);if (ret) { +rte_cryptodev_pmd_destroy (priv->crypto_dev);DRV_LOG (ERR ,"Failed to init AES-XTS crypto." );return -ENOTSUP ; }
Signature · 1 line
2.34.1
Akhil Goyal
AppliedQuoted 9 lines
For the case crypto initialize failed, the allocated crypto dev should be destroyed, otherwise the dev leaked. Current PMD returns directly instead of releasing the dev.
This commit fixes the crypto dev leak when initialize failed.
Fixes a27f6a2e1f30 ("crypto/mlx5: split AES-XTS")Signed-off-by Suanming Mou <[email protected]>Acked-by Matan Azrad <[email protected]>
Applied to dpdk-next-crypto