From 381dfcf04717f92cfea68e53aac1979c098d35a4 Mon Sep 17 00:00:00 2001 From: "Min Hu (Connor)" Date: Thu, 22 Apr 2021 11:56:29 +0800 Subject: [PATCH] test/kni: check init result Return value 'rte_kni_init' of a function is not checked. If it fails, error handling (logging and return) should be done. This patch fixed it. Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- app/test/test_kni.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 3470005790..96733554b6 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -563,7 +563,11 @@ test_kni(void) closedir(dir); /* Initialize KNI subsystem */ - rte_kni_init(KNI_TEST_MAX_PORTS); + ret = rte_kni_init(KNI_TEST_MAX_PORTS); + if (ret < 0) { + printf("fail to initialize KNI subsystem\n"); + return -1; + } if (test_kni_allocate_lcores() < 0) { printf("No enough lcores for kni processing\n"); -- 2.20.1