Re: [PATCH net 1/2] net/mlx5: Fix memory leak in cmd_exec()
From: Simon Horman
Date: Fri Jul 18 2025 - 09:59:11 EST
On Thu, Jul 17, 2025 at 03:06:09PM +0300, Tariq Toukan wrote:
> From: Chiara Meiohas <cmeiohas@xxxxxxxxxx>
>
> If cmd_exec() is called with callback and mlx5_cmd_invoke() returns an
> error, resources allocated in cmd_exec() will not be freed.
>
> Fix the code to release the resources if mlx5_cmd_invoke() returns an
> error.
>
> Fixes: f086470122d5 ("net/mlx5: cmdif, Return value improvements")
> Reported-by: Alex Tereshkin <atereshkin@xxxxxxxxxx>
> Signed-off-by: Chiara Meiohas <cmeiohas@xxxxxxxxxx>
> Reviewed-by: Moshe Shemesh <moshe@xxxxxxxxxx>
> Signed-off-by: Vlad Dumitrescu <vdumitrescu@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>