diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-05 12:10:38 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-05 12:10:38 +0200 |
commit | 4341012c670df5ad59ab9c7ddf3b56924c8c324a (patch) | |
tree | c4063480d6b1312d51677d1ed891169ffaacea53 /kern | |
parent | 5a89edc318bcf06341ca2855b743615cdfad840a (diff) | |
download | gnumach-4341012c670df5ad59ab9c7ddf3b56924c8c324a.tar.gz gnumach-4341012c670df5ad59ab9c7ddf3b56924c8c324a.tar.bz2 gnumach-4341012c670df5ad59ab9c7ddf3b56924c8c324a.zip |
thread_info: Fix crash when requesting for thread that never ran
* kern/thread.c (thread_info): Set last_processor to 0 when the thread
never ran.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/thread.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kern/thread.c b/kern/thread.c index dfc6ff68..903fb559 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1613,10 +1613,11 @@ kern_return_t thread_info( sched_info->depress_priority = thread->depress_priority; #if NCPUS > 1 - sched_info->last_processor = thread->last_processor->slot_num; -#else - sched_info->last_processor = 0; + if (thread->last_processor) + sched_info->last_processor = thread->last_processor->slot_num; + else #endif + sched_info->last_processor = 0; thread_unlock(thread); splx(s); |