From: Chengwen Feng <fengcheng...@huawei.com> This patch adds checking for rte_kni_init() result.
Fixes: 75e2bc54c018 ("net/kni: add KNI PMD") Cc: sta...@dpdk.org Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> Signed-off-by: Min Hu (Connor) <humi...@huawei.com> --- drivers/net/kni/rte_eth_kni.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 9ce74e5..4d2a42d 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++; -- 2.7.4