From a67323e49c47380604c0dece509ffd9b7e58cfc3 Mon Sep 17 00:00:00 2001 From: Shahaf Shuler Date: Sun, 22 Jan 2017 10:24:47 +0200 Subject: [PATCH] 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 --- drivers/net/mlx5/mlx5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.20.1