diff mbox series

[v2,36/83] crypto/openssl: remove unnecessary NULL checks

Message ID 20220124174719.14417-37-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 5:46 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 52715f86f84a..b1c0b14fefd2 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -659,8 +659,7 @@  openssl_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 	if (dev->data->queue_pairs[qp_id] != NULL) {
 		struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
 
-		if (qp->processed_ops)
-			rte_ring_free(qp->processed_ops);
+		rte_ring_free(qp->processed_ops);
 
 		rte_free(dev->data->queue_pairs[qp_id]);
 		dev->data->queue_pairs[qp_id] = NULL;
@@ -748,8 +747,7 @@  openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	return 0;
 
 qp_setup_cleanup:
-	if (qp)
-		rte_free(qp);
+	rte_free(qp);
 
 	return -1;
 }