mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 03:35:32 -04:00
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
This commit is contained in:
committed by
Thomas Gleixner
parent
dc59e4fea9
commit
13856e2221
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user