]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 5 Jul 2023 12:15:27 +0000 (20:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 13:13:50 +0000 (15:13 +0200)
commit00cecb0a8f9e7a21754d5ad85813ab6b47b3308f
tree71be41fd3968a30bb893dcd845e558416e358ed9
parent4c224ea31bedb379485ddbd7e8062384f9a02262
net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx

[ Upstream commit 5dd77585dd9d0e03dd1bceb95f0269a7eaf6b936 ]

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: 1d9186476e12 ("net/mlx5: DR, Add direct rule command utilities")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c