提交 3e933133 编写于 作者: M Marc Zyngier 提交者: Xie XiuQi

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

mainline inclusion
from mainline-5.0
commit 45725e0fc3e7
category: bugfix
bugzilla: 9453
CVE: NA

-------------------------------------------------

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: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NBixuan Cui <cuibixuan@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 48ea47f0
...@@ -1586,6 +1586,9 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids) ...@@ -1586,6 +1586,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册