mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump
In mlx5_fw_fatal_reporter_dump if mlx5_crdump_collect fails the
allocated memory for cr_data must be released otherwise there will be
memory leak. To fix this, this commit changes the return instruction
into goto error handling.
Fixes: 9b1f298236
("net/mlx5: Add support for FW fatal reporter dump")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
c8c2a057fd
commit
c7ed6d0183
1 changed files with 1 additions and 1 deletions
|
@ -572,7 +572,7 @@ mlx5_fw_fatal_reporter_dump(struct devlink_health_reporter *reporter,
|
|||
return -ENOMEM;
|
||||
err = mlx5_crdump_collect(dev, cr_data);
|
||||
if (err)
|
||||
return err;
|
||||
goto free_data;
|
||||
|
||||
if (priv_ctx) {
|
||||
struct mlx5_fw_reporter_ctx *fw_reporter_ctx = priv_ctx;
|
||||
|
|
Loading…
Reference in a new issue