summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyun Yoo <easetheworld@gmail.com>2015-08-05 14:58:04 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-08-10 16:25:30 +0200
commit10cbac6ae95e27f99d81d4d6a4e00bf73de3ef13 (patch)
treed5be8d1512e43904d78b2831b1c9931960daa407
parentb7f477920f7be7052e8d5de9ea14f61aba7597d3 (diff)
downloaddpdk-10cbac6ae95e27f99d81d4d6a4e00bf73de3ef13.zip
dpdk-10cbac6ae95e27f99d81d4d6a4e00bf73de3ef13.tar.gz
dpdk-10cbac6ae95e27f99d81d4d6a4e00bf73de3ef13.tar.xz
examples/kni: fix crash on exit
In kni_free_kni(), p[i] should be p[port_id]. Signed-off-by: Hyun Yoo <easetheworld@gmail.com> Acked-by: Helin Zhang <helin.zhang@intel.com>
-rw-r--r--examples/kni/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 6f74d8e..6d434ad 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);