Commit 423869f8 authored by Marc Zyngier's avatar Marc Zyngier Committed by Greg Kroah-Hartman

irqchip/gic-v3-its: Gracefully fail on LPI exhaustion

[ Upstream commit 45725e0f ]

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: 38dd7c49 ("irqchip/gic-v3-its: Drop chunk allocation compatibility")
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dc81cfaf
...@@ -1581,6 +1581,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) ...@@ -1581,6 +1581,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
nr_irqs /= 2; nr_irqs /= 2;
} while (nr_irqs > 0); } while (nr_irqs > 0);
if (!nr_irqs)
err = -ENOSPC;
if (err) if (err)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment