summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-05-25 22:35:07 +0800
committerSimon Glass <sjg@chromium.org>2015-06-04 02:39:39 -0600
commit67b24970cef90b6d230e370cce9db8c29b2f4d74 (patch)
treec653792200965525d251f682268ae79335f61df0
parent05b98ec3468547057666dd685b2a1615298c24cc (diff)
x86: Do sanity test on pirq table before writing
If pirq_routing_table points to NULL, that means U-Boot fails to generate the table before in create_pirq_routing_table(), so we test it against NULL before actually writing it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/x86/cpu/irq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index d1711af8f8..74b89ad2ff 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -209,5 +209,8 @@ void pirq_init(void)
u32 write_pirq_routing_table(u32 addr)
{
+ if (!pirq_routing_table)
+ return addr;
+
return copy_pirq_routing_table(addr, pirq_routing_table);
}