[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL |
Date: |
Tue, 19 Nov 2013 20:51:58 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Tue 19 Nov 2013 07:34:23 +0100, a écrit :
> Check if active_threads is NULL before calling current_task() to
> avoid dereference of null pointer.
Same here.
> * 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
>
>
--
Samuel
Anyone who thinks UNIX is intuitive should be forced to write 5000 lines of
code using nothing but vi or emacs. AAAAACK!
(Discussion in comp.os.linux.misc on the intuitiveness of commands, especially
Emacs.)
- [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
- Re: [PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL,
Samuel Thibault <=
- [PATCH 4/5] vm/vm_fault.c: check if active_threads is NULL, Marin Ramesa, 2013/11/19