[tip: irq/core] genirq/msi: Avoid freeing borrowed firmware nodes
From: tip-bot2 for Avi Weiss
Date: Sun Nov 08 2026 - 11:44:05 EST
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 <thnkslprpt@xxxxxxxxx>
AuthorDate: Sun, 25 Oct 2026 14:12:42 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
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.
Fixes: 9d1c58c80046 ("genirq/msi: Optionally use dev->fwnode for device domain")
Signed-off-by: Avi Weiss <thnkslprpt@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Link: https://patch.msgid.link/20261025121242.2169180-1-thnkslprpt@xxxxxxxxx
---
kernel/irq/msi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index b22d744..e1d8503 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -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));
}