From: Saeed Mahameed <saeedm@mellanox.com>
To: "navid.emamdoost@gmail.com" <navid.emamdoost@gmail.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"emamd001@umn.edu" <emamd001@umn.edu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"smccaman@umn.edu" <smccaman@umn.edu>,
"leon@kernel.org" <leon@kernel.org>,
"kjlu@umn.edu" <kjlu@umn.edu>
Subject: Re: [PATCH] net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump
Date: Tue, 15 Oct 2019 20:33:28 +0000 [thread overview]
Message-ID: <721412ca4de2a496f6869b9620e7b47382582dde.camel@mellanox.com> (raw)
In-Reply-To: <20190927223729.18043-1-navid.emamdoost@gmail.com>
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@gmail.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;
prev parent reply other threads:[~2019-10-15 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 22:37 [PATCH] net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump Navid Emamdoost
2019-09-28 6:07 ` Leon Romanovsky
2019-10-15 20:33 ` Saeed Mahameed [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=721412ca4de2a496f6869b9620e7b47382582dde.camel@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=smccaman@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).