[PATCH] irqchip/msi-lib: Fix fwnode refcount in msi_lib_irq_domain_select()

Lorenzo Pieralisi lpieralisi at kernel.org
Tue Aug 5 02:23:04 PDT 2025


On Tue, Aug 05, 2025 at 10:31:32AM +0200, Thomas Gleixner wrote:
> On Mon, Aug 04 2025 at 16:55, Lorenzo Pieralisi wrote:
> >
> > msi_lib_irq_domain_select() is used in other arches, I could not
> > test on those (don't know if they have non-[DT/irqchip/acpi] specific
> > fwnodes) - from a fwnode interface perspective I think that this patch
> > does the right thing, it should not add any issue to existing code
> > to the best of my knowledge but it has to be verified.
> 
> fwnode handles are architecture and firmware agnostic.

Yep, though to make sure this does not trigger regressions I started
checking (ie I am adding an additional fwnode_handle_get/put() in there),
some fwnode helpers (eg fwnode_find_reference()) returns an error
pointer rather than NULL on error, it looks like calling
fwnode_handle_put() on that value when OF is in use is not a good idea
(ie of_node_put() checks for NULL and dereference).

There is code out there that implicitly assumes what fwnode types
are used behind the fwnode_* interface or I am missing something.

It is not arch dependent but it looks like it depends on what fwnodes
arches use - that's where my caution stems from, nothing else.

Thanks,
Lorenzo



More information about the linux-arm-kernel mailing list