genirq/msi: avoid freeing borrowed firmware nodes
Subsystems (3)
PATCH 1/1 genirq/msi: avoid freeing borrowed firmware nodes
msi_create_device_irq_domain() uses dev->fwnode when MSI_FLAG_USE_DEV_FWNODE is set, but msi_remove_device_irq_domain() passes it to irq_domain_free_fwnode(). This triggers a warning for firmware nodes not allocated by the IRQ domain code.
Only free the firmware node when the MSI core allocated it.
--- kernel/irq/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/msi.c +2 -1
@@ -1129,7 +1129,8 @@ void msi_remove_device_irq_domain(struct device *dev, unsigned int domid)if (irq_domain_is_msi_device (domain)) fwnode = domain->fwnode;irq_domain_remove (domain); -irq_domain_free_fwnode (fwnode); +if (!(info->flags &MSI_FLAG_USE_DEV_FWNODE )) +irq_domain_free_fwnode (fwnode);kfree (container_of(info ,struct msi_domain_template ,info )); }
Signature · 1 line
2.43.0
[tip: irq/core] genirq/msi: Avoid freeing borrowed firmware nodes
The following commit has been merged into the irq/core branch of tip:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: b22795dece39a7e200a1eb750ee3511ac892816d Gitweb: https://git.kernel.org/tip/b22795dece39a7e200a1eb750ee3511ac892816d Author: Avi Weiss <[email protected]> AuthorDate: Sun, 25 Oct 2026 14:12:42 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sun, 08 Nov 2026 17:39:43 +01:00
genirq/msi: Avoid freeing borrowed firmware nodes
msi_create_device_irq_domain() uses dev->fwnode when MSI_FLAG_USE_DEV_FWNODE is set, but msi_remove_device_irq_domain() passes it to irq_domain_free_fwnode(). This triggers a warning for firmware nodes not allocated by the IRQ domain code.
Only free the firmware node when the MSI core allocated it.
--- kernel/irq/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/msi.c +2 -1
@@ -1129,7 +1129,8 @@ void msi_remove_device_irq_domain(struct device *dev, unsigned int domid)if (irq_domain_is_msi_device (domain)) fwnode = domain->fwnode;irq_domain_remove (domain); -irq_domain_free_fwnode (fwnode); +if (!(info->flags &MSI_FLAG_USE_DEV_FWNODE )) +irq_domain_free_fwnode (fwnode);kfree (container_of(info ,struct msi_domain_template ,info )); }