summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2026-06-23 15:51:32 +0800
committerThomas Gleixner <tglx@kernel.org>2026-06-29 15:42:26 +0200
commit13856e22217fbf7c1200633716ff87ccb50fd89a (patch)
tree17737a6a147428fda6a96e5e57422b393869966b
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
downloadlinux-13856e22217fbf7c1200633716ff87ccb50fd89a.tar.gz
linux-13856e22217fbf7c1200633716ff87ccb50fd89a.zip
irqdomain: Plug leak in irq_domain_alloc_irqs_locked() error path
When irq_domain_trim_hierarchy() fails in irq_domain_alloc_irqs_locked(), the error handling path fails to undo the hierarchy allocations. Add the missing cleanup. [ tglx: Massage change log ] Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260623075134.4432-2-shikemeng@huaweicloud.com
-rw-r--r--kernel/irq/irqdomain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index f15c9f1223bb..f76f516a2cc3 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1658,7 +1658,7 @@ static int irq_domain_alloc_irqs_locked(struct irq_domain *domain, int irq_base,
for (i = 0; i < nr_irqs; i++) {
ret = irq_domain_trim_hierarchy(virq + i);
if (ret)
- goto out_free_irq_data;
+ goto out_free_irqs;
}
for (i = 0; i < nr_irqs; i++)
@@ -1666,6 +1666,8 @@ static int irq_domain_alloc_irqs_locked(struct irq_domain *domain, int irq_base,
return virq;
+out_free_irqs:
+ irq_domain_free_irqs_hierarchy(domain, virq, nr_irqs);
out_free_irq_data:
irq_domain_free_irq_data(virq, nr_irqs);
out_free_desc: