Skip to contentSkip to conversation

examples/kni: Fix segmentation fault at program exit

PATCH Applied Hyun Yoo 3 participants 3 messages Aug 5, 2015 – Aug 10, 2015

lore
Share & tools
lore

Hyun Yoo

author
#0 lore raw

PATCH 1/1 examples/kni: Fix segmentation fault at program exit

In kni_free_kni(), p[i] should be p[port_id]

Signed-off-by Hyun Yoo <easetheworld <at> gmail.com>
---
 examples/kni/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
examples/kni/main.c +3 -3
index 6f74d8e..6d434ad 100644
@@ -830,9 +830,9 @@ kni_free_kni(uint8_t port_id)
 	if (port_id >= RTE_MAX_ETHPORTS || !p[port_id])
 		return -1;
 
-	for (i = 0; i < p[i]->nb_kni; i++) {
-		rte_kni_release(p[i]->kni[i]);
-		p[i]->kni[i] = NULL;
+	for (i = 0; i < p[port_id]->nb_kni; i++) {
+		rte_kni_release(p[port_id]->kni[i]);
+		p[port_id]->kni[i] = NULL;
 	}
 	rte_eth_dev_stop(port_id);
 
Signature · 1 line
1.9.1