net/mlx5: fix memory leak when parsing device params
authorShahaf Shuler <shahafs@mellanox.com>
Sun, 22 Jan 2017 08:24:47 +0000 (10:24 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 30 Jan 2017 21:18:26 +0000 (22:18 +0100)
in case of an error argument list is not freed.

Fixes: e72dd09b614e ("net/mlx5: add support for configuration through kvargs")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5.c

index 109d957..d4bd469 100644 (file)
@@ -333,8 +333,10 @@ mlx5_args(struct priv *priv, struct rte_devargs *devargs)
                if (rte_kvargs_count(kvlist, params[i])) {
                        ret = rte_kvargs_process(kvlist, params[i],
                                                 mlx5_args_check, priv);
-                       if (ret != 0)
+                       if (ret != 0) {
+                               rte_kvargs_free(kvlist);
                                return ret;
+                       }
                }
        }
        rte_kvargs_free(kvlist);