DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Kai Ji <kai.ji@intel.com>
Subject: [PATCH] crypto/openssl: remove unneccessary null free checks
Date: Wed, 13 Nov 2024 07:56:21 -0800	[thread overview]
Message-ID: <20241113155622.12011-1-stephen@networkplumber.org> (raw)

The function EVP_PKEY_CTX_free allows NULL parameter
(similar to free()).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 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;
 }
-- 
2.45.2


                 reply	other threads:[~2024-11-13 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241113155622.12011-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=kai.ji@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).