Skip to content

Commit dbec370

Browse files
seehearfeelMarc Zyngier
authored andcommitted
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: 818e915 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 652d54e commit dbec370

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/irqchip/irq-loongson-htvec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,14 @@ static struct irq_chip htvec_irq_chip = {
109109
static int htvec_domain_alloc(struct irq_domain *domain, unsigned int virq,
110110
unsigned int nr_irqs, void *arg)
111111
{
112+
int ret;
112113
unsigned long hwirq;
113114
unsigned int type, i;
114115
struct htvec *priv = domain->host_data;
115116

116-
irq_domain_translate_onecell(domain, arg, &hwirq, &type);
117+
ret = irq_domain_translate_onecell(domain, arg, &hwirq, &type);
118+
if (ret)
119+
return ret;
117120

118121
for (i = 0; i < nr_irqs; i++) {
119122
irq_domain_set_info(domain, virq + i, hwirq + i, &htvec_irq_chip,

0 commit comments

Comments
 (0)