[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <721412ca4de2a496f6869b9620e7b47382582dde.camel@mellanox.com>
Date: Tue, 15 Oct 2019 20:33:28 +0000
From: Saeed Mahameed <saeedm@...lanox.com>
To: "navid.emamdoost@...il.com" <navid.emamdoost@...il.com>
CC: "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"emamd001@....edu" <emamd001@....edu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"smccaman@....edu" <smccaman@....edu>,
"leon@...nel.org" <leon@...nel.org>, "kjlu@....edu" <kjlu@....edu>
Subject: Re: [PATCH] net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump
On Fri, 2019-09-27 at 17:37 -0500, Navid Emamdoost wrote:
> 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: 9b1f29823605 ("net/mlx5: Add support for FW fatal reporter
> dump")
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
>
Applied to net-next-mlx5, will be sent to net-next shortly, i will fix
the extra empty line as Leon pointed out.
Thanks,
Saeed.
> ---
> drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> index d685122d9ff7..c07f3154437c 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
> @@ -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;
Powered by blists - more mailing lists