Commit bb52c616 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by sanglipeng
Browse files

net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx

stable inclusion
from stable-v5.10.190
commit 165159854757dbae0dfd1812b27051da35aa6223
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I928UI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=165159854757dbae0dfd1812b27051da35aa6223



--------------------------------

[ Upstream commit 5dd77585 ]

when mlx5_cmd_exec failed in mlx5dr_cmd_create_reformat_ctx, the memory
pointed by 'in' is not released, which will cause memory leak. Move memory
release after mlx5_cmd_exec.

Fixes: 1d918647 ("net/mlx5: DR, Add direct rule command utilities")
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 2c4f7e6f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment