[Skiboot] [PATCH] core/cpu.c: assert pir is sane before using

Stewart Smith stewart at linux.ibm.com
Thu Jul 19 19:41:44 AEST 2018


Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 core/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/cpu.c b/core/cpu.c
index 8c55178a40c3..b5bfb2773cea 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -1151,6 +1151,7 @@ void init_all_cpus(void)
 		      " State=%d\n", pir, server_no, state);
 
 		/* Setup thread 0 */
+		assert(pir <= cpu_max_pir);
 		t = pt = &cpu_stacks[pir].cpu;
 		if (t != boot_cpu) {
 			init_cpu_thread(t, state, pir);
-- 
2.17.1



More information about the Skiboot mailing list