From: Marc Zyngier <maz@kernel.org>
To: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: tglx@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] irqchip/gic-v3-its: Fix memleak in its_probe_one()
Date: Mon, 15 Jun 2026 09:59:14 +0100 [thread overview]
Message-ID: <87ik7k89i5.wl-maz@kernel.org> (raw)
In-Reply-To: <20260615032910.54735-3-shikemeng@huaweicloud.com>
On Mon, 15 Jun 2026 04:29:06 +0100,
Kemeng Shi <shikemeng@huaweicloud.com> wrote:
>
> Fix collection leak when its_init_domain() failed in its_probe_one().
>
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
> drivers/irqchip/irq-gic-v3-its.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 2b7b546c43c8..df26ddc97ae2 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -3032,6 +3032,12 @@ static int its_alloc_collections(struct its_node *its)
> return 0;
> }
>
> +static void its_free_collections(struct its_node *its)
> +{
> + kfree(its->collections);
> + its->collections = NULL;
> +}
Why do we need an extra helper for something that has a single calling
spot? Why is it important to set collections to NULL, given that we're
about to free the structure without even looking further?
M.
--
Jazz isn't dead. It just smells funny.
next prev parent reply other threads:[~2026-06-15 8:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 3:29 [PATCH 0/6] Some random fixes and cleanups to irqchip/gic-v3-its Kemeng Shi
2026-06-15 3:29 ` [PATCH 1/6] irqchip/gic-v3-its: Fix LPI range leak and refactor error handler in its_lpi_alloc() Kemeng Shi
2026-06-15 8:52 ` Marc Zyngier
2026-06-15 3:29 ` [PATCH 2/6] irqchip/gic-v3-its: Fix memleak in its_probe_one() Kemeng Shi
2026-06-15 8:59 ` Marc Zyngier [this message]
2026-06-15 3:29 ` [PATCH 3/6] irqchip/gic-v3-its: Fix its node leak in gic_acpi_parse_madt_its() Kemeng Shi
2026-06-15 3:29 ` [PATCH 4/6] irqchip/gic-v3-its: Add ITS address info in more error logs Kemeng Shi
2026-06-15 9:01 ` Marc Zyngier
2026-06-15 3:29 ` [PATCH 5/6] irqchip/gic-v3-its: fix typo in comments Kemeng Shi
2026-06-15 9:03 ` Marc Zyngier
2026-06-15 3:29 ` [PATCH 6/6] irqchip/gic-v3-its: some minor cleanups Kemeng Shi
2026-06-15 9:14 ` Marc Zyngier
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=87ik7k89i5.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shikemeng@huaweicloud.com \
--cc=tglx@kernel.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