diff mbox series

[39/82] net/axgbe: remove unnecessary NULL checks

Message ID 20220124000518.319850-40-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/net/axgbe/axgbe_rxtx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index 6bd41d3002bf..f38bb64fab6b 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -22,8 +22,7 @@  axgbe_rx_queue_release(struct axgbe_rx_queue *rx_queue)
 		sw_ring = rx_queue->sw_ring;
 		if (sw_ring) {
 			for (i = 0; i < rx_queue->nb_desc; i++) {
-				if (sw_ring[i])
-					rte_pktmbuf_free(sw_ring[i]);
+				rte_pktmbuf_free(sw_ring[i]);
 			}
 			rte_free(sw_ring);
 		}
@@ -507,8 +506,7 @@  static void axgbe_tx_queue_release(struct axgbe_tx_queue *tx_queue)
 		sw_ring = tx_queue->sw_ring;
 		if (sw_ring) {
 			for (i = 0; i < tx_queue->nb_desc; i++) {
-				if (sw_ring[i])
-					rte_pktmbuf_free(sw_ring[i]);
+				rte_pktmbuf_free(sw_ring[i]);
 			}
 			rte_free(sw_ring);
 		}