aboutsummaryrefslogtreecommitdiffstats
path: root/mm/nommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/nommu.c')
-rw-r--r--mm/nommu.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 6a2a8aada401..af874569d0f1 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -808,10 +808,9 @@ unsigned long do_mmap_pgoff(struct file *file,
808 vm_flags = determine_vm_flags(file, prot, flags, capabilities); 808 vm_flags = determine_vm_flags(file, prot, flags, capabilities);
809 809
810 /* we're going to need to record the mapping if it works */ 810 /* we're going to need to record the mapping if it works */
811 vml = kmalloc(sizeof(struct vm_list_struct), GFP_KERNEL); 811 vml = kzalloc(sizeof(struct vm_list_struct), GFP_KERNEL);
812 if (!vml) 812 if (!vml)
813 goto error_getting_vml; 813 goto error_getting_vml;
814 memset(vml, 0, sizeof(*vml));
815 814
816 down_write(&nommu_vma_sem); 815 down_write(&nommu_vma_sem);
817 816
@@ -887,11 +886,10 @@ unsigned long do_mmap_pgoff(struct file *file,
887 } 886 }
888 887
889 /* we're going to need a VMA struct as well */ 888 /* we're going to need a VMA struct as well */
890 vma = kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL); 889 vma = kzalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
891 if (!vma) 890 if (!vma)
892 goto error_getting_vma; 891 goto error_getting_vma;
893 892
894 memset(vma, 0, sizeof(*vma));
895 INIT_LIST_HEAD(&vma->anon_vma_node); 893 INIT_LIST_HEAD(&vma->anon_vma_node);
896 atomic_set(&vma->vm_usage, 1); 894 atomic_set(&vma->vm_usage, 1);
897 if (file) 895 if (file)