diff mbox series

[v2,83/83] reorder: remove unnecessary NULL checks

Message ID 20220124174719.14417-84-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/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

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

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

Patch

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index 9445853b79cc..bc0241bfb3fd 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -192,10 +192,8 @@  rte_reorder_free_mbufs(struct rte_reorder_buffer *b)
 
 	/* Free up the mbufs of order buffer & ready buffer */
 	for (i = 0; i < b->order_buf.size; i++) {
-		if (b->order_buf.entries[i])
-			rte_pktmbuf_free(b->order_buf.entries[i]);
-		if (b->ready_buf.entries[i])
-			rte_pktmbuf_free(b->ready_buf.entries[i]);
+		rte_pktmbuf_free(b->order_buf.entries[i]);
+		rte_pktmbuf_free(b->ready_buf.entries[i]);
 	}
 }