Skip to content

Commit

Permalink
crypto/openssl: remove unnecessary null free checks
Browse files Browse the repository at this point in the history
The function EVP_PKEY_CTX_free allows NULL parameter
(similar to free()).

Signed-off-by: Stephen Hemminger <[email protected]>
  • Loading branch information
shemminger authored and Akhil Goyal committed Nov 19, 2024
1 parent 2cf2f84 commit 0e361f5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/crypto/openssl/rte_openssl_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0e361f5

Please sign in to comment.