Skip to content

Commit

Permalink
irqchip/gic-v3-its: Gracefully fail on LPI exhaustion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Zyngier committed Jan 29, 2019
1 parent 9791ec7 commit 45725e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/irqchip/irq-gic-v3-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
nr_irqs /= 2;
} while (nr_irqs > 0);

if (!nr_irqs)
err = -ENOSPC;

if (err)
goto out;

Expand Down

0 comments on commit 45725e0

Please sign in to comment.