From: Hyun Yoo Date: Wed, 5 Aug 2015 21:58:04 +0000 (-0700) Subject: examples/kni: fix crash on exit X-Git-Tag: spdx-start~8546 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=10cbac6ae95e27f99d81d4d6a4e00bf73de3ef13;p=dpdk.git examples/kni: fix crash on exit In kni_free_kni(), p[i] should be p[port_id]. Signed-off-by: Hyun Yoo Acked-by: Helin Zhang --- diff --git a/examples/kni/main.c b/examples/kni/main.c index 6f74d8eda2..6d434ad3d5 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -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);