diff mbox series

[v2,34/83] crypto/null: remove unnecessary NULL checks

Message ID 20220124174719.14417-35-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/null/null_crypto_pmd_ops.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/null/null_crypto_pmd_ops.c b/drivers/crypto/null/null_crypto_pmd_ops.c
index a8b5a06e7f4e..90a675dfffe0 100644
--- a/drivers/crypto/null/null_crypto_pmd_ops.c
+++ b/drivers/crypto/null/null_crypto_pmd_ops.c
@@ -135,8 +135,7 @@  null_crypto_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 	if (dev->data->queue_pairs[qp_id] != NULL) {
 		struct null_crypto_qp *qp = dev->data->queue_pairs[qp_id];
 
-		if (qp->processed_pkts)
-			rte_ring_free(qp->processed_pkts);
+		rte_ring_free(qp->processed_pkts);
 
 		rte_free(dev->data->queue_pairs[qp_id]);
 		dev->data->queue_pairs[qp_id] = NULL;
@@ -241,8 +240,7 @@  null_crypto_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;
 }