From: Shahaf Shuler Date: Sun, 22 Jan 2017 08:24:47 +0000 (+0200) Subject: net/mlx5: fix memory leak when parsing device params X-Git-Tag: spdx-start~4612 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a67323e49c47380604c0dece509ffd9b7e58cfc3;p=dpdk.git net/mlx5: fix memory leak when parsing device params 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 --- diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 109d9572d3..d4bd4696ce 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -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);