diff mbox series

[49/82] net/hns3: remove unnecessary NULL checks

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

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index d240e36e6a86..8a428f88f48e 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -86,8 +86,7 @@  hns3_rx_queue_release(void *queue)
 		hns3_rx_queue_release_mbufs(rxq);
 		if (rxq->mz)
 			rte_memzone_free(rxq->mz);
-		if (rxq->sw_ring)
-			rte_free(rxq->sw_ring);
+		rte_free(rxq->sw_ring);
 		rte_free(rxq);
 	}
 }
@@ -100,10 +99,8 @@  hns3_tx_queue_release(void *queue)
 		hns3_tx_queue_release_mbufs(txq);
 		if (txq->mz)
 			rte_memzone_free(txq->mz);
-		if (txq->sw_ring)
-			rte_free(txq->sw_ring);
-		if (txq->free)
-			rte_free(txq->free);
+		rte_free(txq->sw_ring);
+		rte_free(txq->free);
 		rte_free(txq);
 	}
 }