mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] genirq/msi: avoid freeing borrowed firmware nodes
@ 2026-10-25 12:12 Avi Weiss
  0 siblings, 0 replies; only message in thread
From: Avi Weiss @ 2026-10-25 12:12 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Radu Rendec, Anup Patel, linux-kernel, Avi Weiss

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@gmail.com>
---
 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 b22d74496af1..e1d85035dbc8 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));
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-25 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 12:12 [PATCH] genirq/msi: avoid freeing borrowed firmware nodes Avi Weiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®