Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 app/pdump/main.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 46f9d25db004..04a38e891119 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -502,14 +502,11 @@ cleanup_rings(void)
        for (i = 0; i < num_tuples; i++) {
                pt = &pdump_t[i];
 
-               if (pt->device_id)
-                       free(pt->device_id);
+               free(pt->device_id);
 
                /* free the rings */
-               if (pt->rx_ring)
-                       rte_ring_free(pt->rx_ring);
-               if (pt->tx_ring)
-                       rte_ring_free(pt->tx_ring);
+               rte_ring_free(pt->rx_ring);
+               rte_ring_free(pt->tx_ring);
        }
 }
 
-- 
2.30.2

Reply via email to