[dpdk-dev] net/mlx5: fix memory leak when parsing device params
diff mbox

Message ID 1485073487-23724-1-git-send-email-shahafs@mellanox.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Shahaf Shuler Jan. 22, 2017, 8:24 a.m. UTC
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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ferruh Yigit Jan. 23, 2017, 12:04 p.m. UTC | #1
On 1/22/2017 8:24 AM, Shahaf Shuler wrote:
> 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>


Applied to dpdk-next-net/master, thanks.

Patch
diff mbox

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 8da29d2..d527e5b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -339,8 +339,10 @@ 
 		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);