[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/5] vm/vm_fault.c: check if active_threads is NULL
From: |
Marin Ramesa |
Subject: |
[PATCH 4/5] vm/vm_fault.c: check if active_threads is NULL |
Date: |
Tue, 19 Nov 2013 07:34:22 +0100 |
Check is 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 4b30f98..1089491 100644
--- a/vm/vm_fault.c
+++ b/vm/vm_fault.c
@@ -249,7 +249,8 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,
vm_stat_sample(SAMPLED_PC_VM_FAULTS_ANY);
vm_stat.faults++; /* needs lock XXX */
- current_task()->faults++;
+ if (active_threads[(0)] != NULL)
+ current_task()->faults++;
/*
* Recovery actions
--
1.8.1.4
- Re: [PATCH 1/5] kern/slab.c: initialize optimal_embed, (continued)
[PATCH 2/5] kern/slab.c: initialize info_size, Marin Ramesa, 2013/11/19
[PATCH 3/5] kern/processor.c: check if threads is NULL, Marin Ramesa, 2013/11/19
[PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL, Marin Ramesa, 2013/11/19
[PATCH 4/5] vm/vm_fault.c: check if active_threads is NULL,
Marin Ramesa <=