Skip to content

Commit 45725e0

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3-its: Gracefully fail on LPI exhaustion
In the unlikely event that we cannot find any available LPI in the system, we should gracefully return an error instead of carrying on with no LPI allocated at all. Fixes: 38dd7c4 ("irqchip/gic-v3-its: Drop chunk allocation compatibility") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 9791ec7 commit 45725e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
15861586
nr_irqs /= 2;
15871587
} while (nr_irqs > 0);
15881588

1589+
if (!nr_irqs)
1590+
err = -ENOSPC;
1591+
15891592
if (err)
15901593
goto out;
15911594

0 commit comments

Comments
 (0)