examples: check status of getting ethdev info
[dpdk.git] / examples / ip_pipeline / kni.c
index e9262e0..4519685 100644 (file)
@@ -109,6 +109,7 @@ kni_create(const char *name, struct kni_params *params)
        struct rte_kni *k;
        const struct rte_pci_device *pci_dev;
        const struct rte_bus *bus = NULL;
+       int ret;
 
        /* Check input params */
        if ((name == NULL) ||
@@ -123,7 +124,9 @@ kni_create(const char *name, struct kni_params *params)
                return NULL;
 
        /* Resource create */
-       rte_eth_dev_info_get(link->port_id, &dev_info);
+       ret = rte_eth_dev_info_get(link->port_id, &dev_info);
+       if (ret != 0)
+               return NULL;
 
        memset(&kni_conf, 0, sizeof(kni_conf));
        strlcpy(kni_conf.name, name, RTE_KNI_NAMESIZE);