This patch adds checking for rte_kni_init() result.
Fixes:
75e2bc54c018 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
static int
kni_init(void)
{
- if (is_kni_initialized == 0)
- rte_kni_init(MAX_KNI_PORTS);
+ int ret;
+
+ if (is_kni_initialized == 0) {
+ ret = rte_kni_init(MAX_KNI_PORTS);
+ if (ret < 0)
+ return ret;
+ }
is_kni_initialized++;