summaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-loongson-htvec.c
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2020-07-07 05:12:48 +0300
committerMarc Zyngier <maz@kernel.org>2020-07-17 15:41:42 +0300
commitdbec37048d27cee36e103e113b5f9b1852bfe997 (patch)
treebc8ebf13960bd547cf332cbc7da9fc276cfa98f9 /drivers/irqchip/irq-loongson-htvec.c
parent652d54e77a438cf38a5731d8f9983c81e72dc429 (diff)
downloadlinux-dbec37048d27cee36e103e113b5f9b1852bfe997.tar.xz
irqchip/loongson-htvec: Check return value of irq_domain_translate_onecell()
Check the return value of irq_domain_translate_onecell() due to it may returns -EINVAL if failed. Fixes: 818e915fbac5 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/1594087972-21715-5-git-send-email-yangtiezhu@loongson.cn
Diffstat (limited to 'drivers/irqchip/irq-loongson-htvec.c')
-rw-r--r--drivers/irqchip/irq-loongson-htvec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c
index b36d40338323..720cf96ae90e 100644
--- a/drivers/irqchip/irq-loongson-htvec.c
+++ b/drivers/irqchip/irq-loongson-htvec.c
@@ -109,11 +109,14 @@ static struct irq_chip htvec_irq_chip = {
static int htvec_domain_alloc(struct irq_domain *domain, unsigned int virq,
unsigned int nr_irqs, void *arg)
{
+ int ret;
unsigned long hwirq;
unsigned int type, i;
struct htvec *priv = domain->host_data;
- irq_domain_translate_onecell(domain, arg, &hwirq, &type);
+ ret = irq_domain_translate_onecell(domain, arg, &hwirq, &type);
+ if (ret)
+ return ret;
for (i = 0; i < nr_irqs; i++) {
irq_domain_set_info(domain, virq + i, hwirq + i, &htvec_irq_chip,