[PATCH v2 11/83] app/pdump: remove unnecessary NULL checks
Stephen Hemminger
stephen at networkplumber.org
Mon Jan 24 18:46:07 CET 2022
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci
Signed-off-by: Stephen Hemminger <stephen at 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
More information about the dev
mailing list