diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-02-18 14:57:17 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-18 15:15:47 +1100 |
commit | 539487bae4b77d66b5966f5396609f28312bd6ae (patch) | |
tree | 454c3b42f8f0a3709a46787117d73446f9030592 /core | |
parent | 3ab9c423f92e4fa2437b0deb60f2cd26f22a7412 (diff) | |
download | skiboot-539487bae4b77d66b5966f5396609f28312bd6ae.zip skiboot-539487bae4b77d66b5966f5396609f28312bd6ae.tar.gz skiboot-539487bae4b77d66b5966f5396609f28312bd6ae.tar.bz2 |
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 <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/interrupts.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); } /* |