From: Chengwen Feng Date: Wed, 21 Apr 2021 02:14:18 +0000 (+0800) Subject: net/kni: check init result X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7fa949fd1122b2e529c538489e2287736f1540e3;p=dpdk.git net/kni: check init result 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 Signed-off-by: Min Hu (Connor) Acked-by: Ferruh Yigit --- diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 9ce74e549b..4d2a42ddab 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -406,8 +406,13 @@ eth_kni_create(struct rte_vdev_device *vdev, 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++;