From: Avi Weiss <thnkslprpt@gmail.com>
To: tglx@kernel.org
Cc: radu@rendec.net, linux-kernel@vger.kernel.org,
Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] irqdomain: Preserve reused IRQ descriptors on allocation failure
Date: Sat, 31 Oct 2026 21:56:19 +0200 [thread overview]
Message-ID: <20261031195618.4167524-2-thnkslprpt@gmail.com> (raw)
When __irq_domain_alloc_irqs() reuses an existing IRQ descriptor,
irq_domain_alloc_irqs_locked() frees that descriptor if IRQ data or
hierarchy allocation fails. This removes an IRQ descriptor which was
allocated before the call.
Only free descriptors allocated by irq_domain_alloc_irqs_locked().
Leave reused descriptors intact on failure.
Fixes: f8264e34965a ("irqdomain: Introduce new interfaces to support hierarchy irqdomains")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
kernel/irq/irqdomain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 4fdcb6df5306..494a7982f1ab 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1672,7 +1672,8 @@ static int irq_domain_alloc_irqs_locked(struct irq_domain *domain, int irq_base,
out_free_irq_data:
irq_domain_free_irq_data(virq, nr_irqs);
out_free_desc:
- irq_free_descs(virq, nr_irqs);
+ if (!realloc || irq_base < 0)
+ irq_free_descs(virq, nr_irqs);
return ret;
}
base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
--
2.43.0
reply other threads:[~2026-10-31 19:56 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=20261031195618.4167524-2-thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.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®