diff options
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 67253e41bfb0..a191c05e757d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -308,9 +308,15 @@ static struct kmem_cache *vm_area_cachep; | |||
| 308 | /* SLAB cache for mm_struct structures (tsk->mm) */ | 308 | /* SLAB cache for mm_struct structures (tsk->mm) */ |
| 309 | static struct kmem_cache *mm_cachep; | 309 | static struct kmem_cache *mm_cachep; |
| 310 | 310 | ||
| 311 | struct vm_area_struct *vm_area_alloc(void) | 311 | struct vm_area_struct *vm_area_alloc(struct mm_struct *mm) |
| 312 | { | 312 | { |
| 313 | return kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); | 313 | struct vm_area_struct *vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); |
| 314 | |||
| 315 | if (vma) { | ||
| 316 | vma->vm_mm = mm; | ||
| 317 | INIT_LIST_HEAD(&vma->anon_vma_chain); | ||
| 318 | } | ||
| 319 | return vma; | ||
| 314 | } | 320 | } |
| 315 | 321 | ||
| 316 | struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig) | 322 | struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig) |
