diff mbox series

[31/82] crypto/ipsec_mb: remove unnecessary NULL checks

Message ID 20220124000518.319850-32-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, 12:04 a.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

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

Patch

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
index 189262c4ad52..f808da9edf89 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
@@ -102,8 +102,7 @@  ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 
 	if (qp != NULL && rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		r = rte_ring_lookup(qp->name);
-		if (r)
-			rte_ring_free(r);
+		rte_ring_free(r);
 
 #if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM
 		if (qp->mb_mgr)
@@ -291,8 +290,7 @@  ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	if (qp->mb_mgr_mz)
 		rte_memzone_free(qp->mb_mgr_mz);
 #endif
-	if (qp)
-		rte_free(qp);
+	rte_free(qp);
 	return ret;
 }