diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 933c7fbd6b54d0cf4accf77f9906df962380f2e6..18fd4e71c9c13c957bcade0d7b5ccb3190ebe2ca 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -708,11 +708,12 @@ static void __init opal_irq_init(struct device_node *dn) /* Get interrupt property */ irqs = of_get_property(opal_node, "opal-interrupts", &irqlen); - pr_debug("Found %d interrupts reserved for OPAL\n", - irqs ? (irqlen / 4) : 0); + opal_irq_count = irqs ? (irqlen / 4) : 0; + pr_debug("Found %d interrupts reserved for OPAL\n", opal_irq_count); + if (!opal_irq_count) + return; /* Install interrupt handlers */ - opal_irq_count = irqlen / 4; opal_irqs = kzalloc(opal_irq_count * sizeof(unsigned int), GFP_KERNEL); for (i = 0; irqs && i < opal_irq_count; i++, irqs++) { unsigned int irq, virq;