From: "Michael Walle" <mwalle@kernel.org>
To: <longzhao@ambarella.com>, "Bartosz Golaszewski" <brgl@kernel.org>
Cc: "Linus Walleij" <linusw@kernel.org>, <linux-gpio@vger.kernel.org>,
"Long Zhao" <zl020895@163.com>
Subject: Re: [PATCH] gpio: regmap: free the irqchip if adding the irq domain fails
Date: Thu, 05 Nov 2026 09:59:54 +0100 [thread overview]
Message-ID: <DMN5K39I2UG8.2QDS8KH2GH6RS@kernel.org> (raw)
In-Reply-To: <20261103-gpio-regmap-irqchip-leak-v1-1-d038a20840f7@ambarella.com>
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]
On Tue Nov 3, 2026 at 5:47 AM CET, Long Zhao via B4 Relay wrote:
> From: Long Zhao <longzhao@ambarella.com>
>
> gpio_regmap_register() creates a regmap irqchip and then calls
> gpiochip_irqchip_add_domain(). If that call fails, the error path
> only removes the gpiochip, so the irqchip and its domain leak.
>
> Free the irqchip there when this function allocated it. An external
> irq domain is not affected: irq_chip_data stays NULL and the caller
> owns that domain.
>
> Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device")
> Cc: Michael Walle <mwalle@kernel.org>
> Signed-off-by: Long Zhao <longzhao@ambarella.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
next prev parent reply other threads:[~2026-11-05 8:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 4:47 [PATCH] gpio: regmap: free the irqchip if adding the irq domain fails Long Zhao via B4 Relay
2026-11-03 4:47 ` Long Zhao
2026-11-05 8:38 ` Linus Walleij
2026-11-05 8:59 ` Michael Walle [this message]
2026-11-05 12:36 ` Bartosz Golaszewski
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=DMN5K39I2UG8.2QDS8KH2GH6RS@kernel.org \
--to=mwalle@kernel.org \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=longzhao@ambarella.com \
--cc=zl020895@163.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.