diff mbox series

[v2,41/83] net/bnx2x: remove unnecessary NULL checks

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

Patch

diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 66b0512c8695..00ddccf151fd 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -27,8 +27,7 @@  bnx2x_rx_queue_release(struct bnx2x_rx_queue *rx_queue)
 		sw_ring = rx_queue->sw_ring;
 		if (NULL != sw_ring) {
 			for (i = 0; i < rx_queue->nb_rx_desc; i++) {
-				if (NULL != sw_ring[i])
-					rte_pktmbuf_free(sw_ring[i]);
+				rte_pktmbuf_free(sw_ring[i]);
 			}
 			rte_free(sw_ring);
 		}
@@ -172,8 +171,7 @@  bnx2x_tx_queue_release(struct bnx2x_tx_queue *tx_queue)
 		sw_ring = tx_queue->sw_ring;
 		if (NULL != sw_ring) {
 			for (i = 0; i < tx_queue->nb_tx_desc; i++) {
-				if (NULL != sw_ring[i])
-					rte_pktmbuf_free(sw_ring[i]);
+				rte_pktmbuf_free(sw_ring[i]);
 			}
 			rte_free(sw_ring);
 		}