bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL


From: Marin Ramesa
Subject: [PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL
Date: Tue, 19 Nov 2013 07:34:23 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]