net/i40e: check multi-driver option parsing
authorBeilei Xing <beilei.xing@intel.com>
Thu, 8 Feb 2018 13:18:12 +0000 (21:18 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 8 Feb 2018 17:42:14 +0000 (18:42 +0100)
This patch fixes the coverity CHECKED_RETURN issue.

Coverity issue: 261779
Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
Cc: stable@dpdk.org
Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
drivers/net/i40e/i40e_ethdev.c

index 65a4b7a..508b417 100644 (file)
@@ -1107,8 +1107,12 @@ i40e_support_multi_driver(struct rte_eth_dev *dev)
                            "the first invalid or last valid one is used !",
                            ETH_I40E_SUPPORT_MULTI_DRIVER);
 
-       rte_kvargs_process(kvlist, ETH_I40E_SUPPORT_MULTI_DRIVER,
-                          i40e_parse_multi_drv_handler, pf);
+       if (rte_kvargs_process(kvlist, ETH_I40E_SUPPORT_MULTI_DRIVER,
+                              i40e_parse_multi_drv_handler, pf) < 0) {
+               rte_kvargs_free(kvlist);
+               return -EINVAL;
+       }
+
        rte_kvargs_free(kvlist);
        return 0;
 }