[27/82] compress/octeontx: remove unnecessary NULL checks

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

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/compress/octeontx/otx_zip_pmd.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index dd62285b863e..26cdce60a859 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -337,8 +337,7 @@  zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id)
 	if (qp != NULL) {
 		zipvf_q_term(qp);
 
-		if (qp->processed_pkts)
-			rte_ring_free(qp->processed_pkts);
+		rte_ring_free(qp->processed_pkts);
 
 		rte_free(qp);
 		dev->data->queue_pairs[qp_id] = NULL;
@@ -423,10 +422,8 @@  zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 	return 0;
 
 qp_setup_cleanup:
-	if (qp->processed_pkts)
-		rte_ring_free(qp->processed_pkts);
-	if (qp)
-		rte_free(qp);
+	rte_ring_free(qp->processed_pkts);
+	rte_free(qp);
 	return -1;
 }