kni: fix segfault in rte_kni_get
PATCH 1/1 kni: fix segfault in rte_kni_get
Fix a segmentation fault which occurs when the kni_autotest is run in the 'test' application.
This segmenation fault occurs when rte_kni_get() is called with a NULL value for 'name'.
--- lib/librte_kni/rte_kni.c | 3 +++ 1 file changed, 3 insertions(+)
lib/librte_kni/rte_kni.c +3 -0
@@ -744,6 +744,9 @@ rte_kni_get(const char *name)struct rte_kni_memzone_slot *it;struct rte_kni *kni; +if (name ==NULL || name[0 ] =='\0' ) +return NULL ; +/* Note: could be improved perf-wise if necessary */ for (i =0 ; i < kni_memzone_pool.max_ifaces; i++) { it = &kni_memzone_pool.slots[i];
Signature · 1 line
2.18.0.rc1.1.g6f333ff2f
This patch is missing review.
29/06/2018 00:58, Dan Gora:
Quoted 29 lines
Fix a segmentation fault which occurs when the
kni_autotestis run in the 'test' application.This segmenation fault occurs when
rte_kni_get()is called with a NULL value for 'name'.Fixes 0c6bc8ef70ba ("kni: memzone pool for alloc and release")Signed-off-by Dan Gora <[email protected]>--- lib/librte_kni/rte_kni.c | 3 +++ 1 file changed, 3 insertions(+)lib/librte_kni/rte_kni.c +3
-0@@ -744,6 +744,9 @@ rte_kni_get(const char *name)struct rte_kni_memzone_slot *it;struct rte_kni *kni; +if (name ==NULL || name[0 ] =='\0' ) +return NULL ; +/* Note: could be improved perf-wise if necessary */ for (i =0 ; i < kni_memzone_pool.max_ifaces; i++) { it = &kni_memzone_pool.slots[i];
Quoted 10 lines · Dan Gora
Fix a segmentation fault which occurs when the
kni_autotestis run in the 'test' application.This segmenation fault occurs when
rte_kni_get()is called with a NULL value for 'name'.Fixes 0c6bc8ef70ba ("kni: memzone pool for alloc and release")Signed-off-by Dan Gora <[email protected]>
Thomas Monjalon
Applied09/08/2018 11:44, Ferruh Yigit:
Quoted 7 lines · Dan Gora
Quoted 6 lines
Fix a segmentation fault which occurs when the
kni_autotestis run in the 'test' application.This segmenation fault occurs when
rte_kni_get()is called with a NULL value for 'name'.
Quoted 6 lines
Quoted 4 lines
Fixes 0c6bc8ef70ba ("kni: memzone pool for alloc and release")Signed-off-by Dan Gora <[email protected]>Acked-by Ferruh Yigit <[email protected]>
Applied, thanks