diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-11-20 20:41:20 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-11-20 20:41:20 +0100 |
commit | 7d740ab409689eefe9c88e7d1e7d94b8189ddf19 (patch) | |
tree | 562d9066a54aec73b318defc83e70b7dee325ca7 /boot | |
parent | 4f9e2ded8c0f0f40a7798cafa39440a52b41dd85 (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.c | 4 |
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) |