From: Bin Meng Date: Mon, 25 May 2015 14:35:07 +0000 (+0800) Subject: x86: Do sanity test on pirq table before writing X-Git-Tag: KARO-TX6-2015-09-18~1793 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=daf5c72a0c01479108b9d6df73448b5bd4126abf;p=karo-tx-uboot.git 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 Acked-by: Simon Glass --- 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); }