summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2019-01-29 16:19:23 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2019-01-29 16:48:51 +0100
commit45725e0fc3e7fe52fedb94f59806ec50e9618682 (patch)
treecb491f1069fca17cfd03bdf93b8f34d7eda8c1ad /drivers/irqchip
parentirqchip/gic-v3-its: Plug allocation race for devices sharing a DevID (diff)
downloadlinux-45725e0fc3e7fe52fedb94f59806ec50e9618682.tar.xz
linux-45725e0fc3e7fe52fedb94f59806ec50e9618682.zip
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: 38dd7c494cf6 ("irqchip/gic-v3-its: Drop chunk allocation compatibility") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index f25ec92f23ee..c3aba3fc818d 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -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;