irqdomain: Preserve reused IRQ descriptors on allocation failure
Subsystems (2)
PATCH 1/1 irqdomain: Preserve reused IRQ descriptors on allocation failure
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 <[email protected]>
--- kernel/irq/irqdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdomain.c +2 -1
@@ -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
Signature · 1 line
2.43.0