diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-06 23:38:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:41 -0500 |
commit | 4668edc334ee90cf50c382c3e423cfc510b5a126 (patch) | |
tree | ee25ca93e72031f7f333b6c251a57a55ef089c90 /mm/nommu.c | |
parent | 304e61e6fbadec586dfe002b535f169a04248e49 (diff) |
[PATCH] kernel core: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 6 |
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) |