Skip to contentSkip to conversation

app/pdump: free mempool at cleanup resources

PATCH In review Tianli Lai 2 participants 2 messages Feb 24, 2022

lore
Share & tools
lore

Tianli Lai

author
#0 lore raw

PATCH 1/1 app/pdump: free mempool at cleanup resources

the mempool should be free when cleanup resources.

---
 app/pdump/main.c | 4 ++++
 1 file changed, 4 insertions(+)
app/pdump/main.c +4 -0
index 46f9d25..8101078 100644
@@ -510,6 +510,10 @@ struct parse_val {
 			rte_ring_free(pt->rx_ring);
 		if (pt->tx_ring)
 			rte_ring_free(pt->tx_ring);
+		if (pt->mp) {
+			rte_mempool_free(pt->mp);
+			pt->mp = NULL;
+		}
 	}
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw

app/pdump/main.c struct parse_val { · line 515

Quoted 3 lines · On Thu, 24 Feb 2022 20:14:58 +0800 Tianli Lai <[email protected]> wrote:
app/pdump/main.c +3 -0
+		if (pt->mp) {
+			rte_mempool_free(pt->mp);
+			pt->mp = NULL;

Check for null is unnecessary here, rte_mempool_free(NULL) is nop.