Re: [PATCH v3 4/7] gpio: gpiolib: fix allocation order in hierarchical IRQ domains
From: Bartosz Golaszewski
Date: Tue Mar 10 2026 - 05:21:04 EST
On Tue, Mar 10, 2026 at 10:05 AM Linus Walleij <linusw@xxxxxxxxxx> wrote:
>
> On Mon, Mar 9, 2026 at 2:49 PM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
>
> > In gpiochip_hierarchy_irq_domain_alloc(), calling irq_domain_set_info()
> > before irq_domain_alloc_irqs_parent() causes a NULL pointer dereference
> > for slow-bus (SPI/I2C) IRQ chips.
> >
> > irq_domain_set_info() locks the child descriptor, triggering .irq_bus_lock.
> > If the child proxies this lock to the parent, it crashes because
> > parent->chip is not yet allocated.
> >
> > Fix this by allocating the parent IRQs first, ensuring parent->chip is
> > populated before the child's .irq_bus_lock is invoked.
> >
> > Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> > ---
> > changes v3
> > - new patch
>
> Bartosz, tglx: is this something we should apply for fixes?
>
> I think it needs to go into gpiolib for next at minimum, unless
> there is some semantic problem with the patch.
>
Looks good to me. I can take it into v7.0-rc4 via the GPIO tree and
tglx can pull the tag once it's out as a base for the rest of the
series?
Bart