diff options
-rw-r--r-- | kern/processor.c | 2 | ||||
-rw-r--r-- | kern/task.c | 3 | ||||
-rw-r--r-- | kern/thread.c | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/kern/processor.c b/kern/processor.c index 865c324..48e9273 100644 --- a/kern/processor.c +++ b/kern/processor.c @@ -657,6 +657,8 @@ processor_get_assignment( processor_set_t *pset) { int state; + if (processor == PROCESSOR_NULL) + return KERN_INVALID_ARGUMENT; state = processor->state; if (state == PROCESSOR_SHUTDOWN || state == PROCESSOR_OFF_LINE) diff --git a/kern/task.c b/kern/task.c index dcd5371..b384347 100644 --- a/kern/task.c +++ b/kern/task.c @@ -1063,6 +1063,9 @@ kern_return_t task_get_assignment( task_t task, processor_set_t *pset) { + if (task == TASK_NULL) + return KERN_INVALID_ARGUMENT; + if (!task->active) return KERN_FAILURE; diff --git a/kern/thread.c b/kern/thread.c index f52c95b..8b1e9f5 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1974,6 +1974,9 @@ kern_return_t thread_get_assignment( thread_t thread, processor_set_t *pset) { + if (thread == THREAD_NULL) + return KERN_INVALID_ARGUMENT; + *pset = thread->processor_set; pset_reference(*pset); return KERN_SUCCESS; |