소스 검색

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>
Bin Meng 10 년 전
부모
커밋
67b24970ce
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      arch/x86/cpu/irq.c

+ 3 - 0
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);
 }