summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-11-20 20:41:20 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-11-20 20:41:20 +0100
commit7d740ab409689eefe9c88e7d1e7d94b8189ddf19 (patch)
tree562d9066a54aec73b318defc83e70b7dee325ca7 /boot
parent4f9e2ded8c0f0f40a7798cafa39440a52b41dd85 (diff)
boot: fix crash when S_processor_set_tasks is called early
* boot/boot.c (S_processor_set_tasks): Return empty array when task_ihash.nr_items is still 0.
Diffstat (limited to 'boot')
-rw-r--r--boot/boot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/boot/boot.c b/boot/boot.c
index d0e02075..491c1a96 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1994,6 +1994,10 @@ S_processor_set_tasks(mach_port_t processor_set,
error_t err;
size_t i;
+ if (!task_ihash.nr_items)
+ *task_listCnt = 0;
+ return 0;
+
err = vm_allocate (mach_task_self (), (vm_address_t *) task_list,
task_ihash.nr_items * sizeof **task_list, 1);
if (err)