diff options
author | Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> | 2018-09-03 18:33:21 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-09-13 15:19:36 +1000 |
commit | df5da053c459369b4fc4a831dd09ce1859efe436 (patch) | |
tree | 246c9d99505d59e3ae40e4df909b354af37afbdd /core | |
parent | 084e37bab1cf6fb334af3f2c8a77f0f260eb91fe (diff) | |
download | skiboot-df5da053c459369b4fc4a831dd09ce1859efe436.zip skiboot-df5da053c459369b4fc4a831dd09ce1859efe436.tar.gz skiboot-df5da053c459369b4fc4a831dd09ce1859efe436.tar.bz2 |
core/cpu: Fix memory allocation for job array
fixes: 7a3f307e core/cpu: parallelise global CPU register setting jobs
This bug would result in boot-hang on some configurations due to
cpu_wait_job() endlessly waiting for the last bogus jobs[cpu->pir] pointer.
Reported-by: Stephanie Swanson <swanman@us.ibm.com>
Reported-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1373,7 +1373,7 @@ static int64_t cpu_change_all_hid0(struct hid0_change_req *req) struct cpu_thread *cpu; struct cpu_job **jobs; - jobs = zalloc(sizeof(struct cpu_job *) * cpu_max_pir + 1); + jobs = zalloc(sizeof(struct cpu_job *) * (cpu_max_pir + 1)); assert(jobs); for_each_available_cpu(cpu) { @@ -1424,7 +1424,7 @@ static int64_t cpu_cleanup_all(void) struct cpu_thread *cpu; struct cpu_job **jobs; - jobs = zalloc(sizeof(struct cpu_job *) * cpu_max_pir + 1); + jobs = zalloc(sizeof(struct cpu_job *) * (cpu_max_pir + 1)); assert(jobs); for_each_available_cpu(cpu) { |