Check if active_threads is NULL before calling current_task() to avoid dereference of null pointer.
* vm/vm_fault.c (active_threads): Check if it's NULL. --- vm/vm_fault.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 1089491..b8be122 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -550,7 +550,8 @@ vm_fault_return_t vm_fault_page(first_object, first_offset, if (m->inactive) { vm_stat_sample(SAMPLED_PC_VM_REACTIVATION_FAULTS); vm_stat.reactivations++; - current_task()->reactivations++; + if (active_threads[(0)] != NULL) + current_task()->reactivations++; } VM_PAGE_QUEUES_REMOVE(m); -- 1.8.1.4