From 9c57513c3c4dfdbdc9e7e29111dc35985efbd8a7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 13 Nov 2024 07:56:21 -0800 Subject: [PATCH] crypto/openssl: remove unnecessary null free checks The function EVP_PKEY_CTX_free allows NULL parameter (similar to free()). Signed-off-by: Stephen Hemminger --- drivers/crypto/openssl/rte_openssl_pmd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index b2442c7ebf..d2cf20c059 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -3244,14 +3244,11 @@ process_openssl_eddsa_op_evp(struct rte_crypto_op *cop, err_eddsa: OSSL_PARAM_BLD_free(iparam_bld); - if (sctx) - EVP_PKEY_CTX_free(sctx); + EVP_PKEY_CTX_free(sctx); - if (cctx) - EVP_PKEY_CTX_free(cctx); + EVP_PKEY_CTX_free(cctx); - if (pkey) - EVP_PKEY_free(pkey); + EVP_PKEY_free(pkey); return ret; }