diff mbox series

[25/82] common/qat: remove unnecessary NULL checks

Message ID 20220124000518.319850-26-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/common/qat/qat_qp.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index cde421eb7716..57ac8fefca3d 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -175,11 +175,9 @@  qat_qp_setup(struct qat_pci_device *qat_dev,
 
 create_err:
 	if (qp) {
-		if (qp->op_cookie_pool)
-			rte_mempool_free(qp->op_cookie_pool);
+		rte_mempool_free(qp->op_cookie_pool);
 
-		if (qp->op_cookies)
-			rte_free(qp->op_cookies);
+		rte_free(qp->op_cookies);
 
 		rte_free(qp);
 	}
@@ -329,8 +327,7 @@  qat_qp_release(enum qat_device_gen qat_dev_gen, struct qat_qp **qp_addr)
 	for (i = 0; i < qp->nb_descriptors; i++)
 		rte_mempool_put(qp->op_cookie_pool, qp->op_cookies[i]);
 
-	if (qp->op_cookie_pool)
-		rte_mempool_free(qp->op_cookie_pool);
+	rte_mempool_free(qp->op_cookie_pool);
 
 	rte_free(qp->op_cookies);
 	rte_free(qp);