mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[PATCH] kernel core: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
304e61e6fb
commit
4668edc334
6 changed files with 7 additions and 14 deletions
|
|
@ -808,10 +808,9 @@ unsigned long do_mmap_pgoff(struct file *file,
|
|||
vm_flags = determine_vm_flags(file, prot, flags, capabilities);
|
||||
|
||||
/* we're going to need to record the mapping if it works */
|
||||
vml = kmalloc(sizeof(struct vm_list_struct), GFP_KERNEL);
|
||||
vml = kzalloc(sizeof(struct vm_list_struct), GFP_KERNEL);
|
||||
if (!vml)
|
||||
goto error_getting_vml;
|
||||
memset(vml, 0, sizeof(*vml));
|
||||
|
||||
down_write(&nommu_vma_sem);
|
||||
|
||||
|
|
@ -887,11 +886,10 @@ unsigned long do_mmap_pgoff(struct file *file,
|
|||
}
|
||||
|
||||
/* we're going to need a VMA struct as well */
|
||||
vma = kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
|
||||
vma = kzalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
|
||||
if (!vma)
|
||||
goto error_getting_vma;
|
||||
|
||||
memset(vma, 0, sizeof(*vma));
|
||||
INIT_LIST_HEAD(&vma->anon_vma_node);
|
||||
atomic_set(&vma->vm_usage, 1);
|
||||
if (file)
|
||||
|
|
|
|||
Loading…
Reference in a new issue