net/netvsc: check return from kvargs process
authorStephen Hemminger <sthemmin@microsoft.com>
Wed, 26 Sep 2018 09:31:12 +0000 (10:31 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:48 +0000 (18:53 +0200)
Should check return value from processing latency value.

Coverity issue: 322104
Fixes: a25d39a3eb69 ("net/netvsc: allow tuning latency with devargs")

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
drivers/net/netvsc/hn_ethdev.c

index 3092066..8e728d6 100644 (file)
@@ -167,6 +167,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
                NULL
        };
        struct rte_kvargs *kvlist;
+       int ret;
 
        if (!devargs)
                return 0;
@@ -180,9 +181,12 @@ static int hn_parse_args(const struct rte_eth_dev *dev)
                return -EINVAL;
        }
 
-       rte_kvargs_process(kvlist, "latency", hn_set_latency, hv);
+       ret = rte_kvargs_process(kvlist, "latency", hn_set_latency, hv);
+       if (ret)
+               PMD_DRV_LOG(ERR, "Unable to process latency arg\n");
+
        rte_kvargs_free(kvlist);
-       return 0;
+       return ret;
 }
 
 /* Update link status.