mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: Thomas Gleixner <tglx@kernel.org>
Cc: Radu Rendec <radu@rendec.net>,
	Anup Patel <apatel@ventanamicro.com>,
	linux-kernel@vger.kernel.org, Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] genirq/msi: avoid freeing borrowed firmware nodes
Date: Sun, 25 Oct 2026 14:12:42 +0200	[thread overview]
Message-ID: <20261025121242.2169180-1-thnkslprpt@gmail.com> (raw)

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


                 reply	other threads:[~2026-10-25 12:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261025121242.2169180-1-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=apatel@ventanamicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®