From 539487bae4b77d66b5966f5396609f28312bd6ae Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 18 Feb 2015 14:57:17 +1100 Subject: Always create opal-interrupts property Even if empty. The existing Linux code doesn't properly NULL check the result of of_get_property() and will allocate an array of an undefined size if the property is missing, while an empty property is harmless. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Stewart Smith --- core/interrupts.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/interrupts.c b/core/interrupts.c index df48c8d..e3a4151 100644 --- a/core/interrupts.c +++ b/core/interrupts.c @@ -186,10 +186,12 @@ void add_opal_interrupts(void) unlock(&irq_lock); /* The opal-interrupts property has one cell per interrupt, - * it is not a standard interrupt property + * it is not a standard interrupt property. + * + * Note: Even if empty, create it, otherwise some bogus error + * handling in Linux can cause problems. */ - if (irqs) - dt_add_property(opal_node, "opal-interrupts", irqs, count * 4); + dt_add_property(opal_node, "opal-interrupts", irqs, count * 4); } /* -- cgit v1.1