From: Andrew Donnellan <ajd@linux.ibm.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Frederic Barrat <fbarrat@linux.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] cxl: Fix a memory leak in an error handling path
Date: Wed, 13 Jul 2022 02:46:10 +1000 [thread overview]
Message-ID: <6883e31c38d42e23f7205b752a62788ca7d128d4.camel@linux.ibm.com> (raw)
In-Reply-To: <ce5869418f5838187946eb6b11a52715a93ece3d.1657566849.git.christophe.jaillet@wanadoo.fr>
On Mon, 2022-07-11 at 21:14 +0200, Christophe JAILLET wrote:
> A bitmap_zalloc() must be balanced by a corresponding bitmap_free()
> in the
> error handling path of afu_allocate_irqs().
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks for catching this.
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> The error handling path should be done in the reversed order but it
> should
> work as-is.
> ---
> drivers/misc/cxl/irq.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
> index 0ce91d99aead..b730e022a48e 100644
> --- a/drivers/misc/cxl/irq.c
> +++ b/drivers/misc/cxl/irq.c
> @@ -349,6 +349,7 @@ int afu_allocate_irqs(struct cxl_context *ctx,
> u32 count)
>
> out:
> cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
> + bitmap_free(ctx->irq_bitmap);
> afu_irq_name_free(ctx);
> return -ENOMEM;
> }
next prev parent reply other threads:[~2022-07-12 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 19:14 [PATCH 1/2] cxl: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-11 19:14 ` [PATCH 2/2] cxl: Fix a memory leak in an error handling path Christophe JAILLET
2022-07-12 16:46 ` Andrew Donnellan [this message]
2022-07-12 16:42 ` [PATCH 1/2] cxl: Use the bitmap API to allocate bitmaps Andrew Donnellan
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=6883e31c38d42e23f7205b752a62788ca7d128d4.camel@linux.ibm.com \
--to=ajd@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=fbarrat@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).