aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2007-02-10 04:45:03 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:27 -0500
commitc376222960ae91d5ffb9197ee36771aaed1d9f90 (patch)
tree7f431c42529fec77433d33490bd9f2a8c47ba091 /arch/ia64/ia32
parent1b135431abf5ea92e61bf4e91d93726c7b96da5f (diff)
[PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc().
Replace appropriate pairs of "kmem_cache_alloc()" + "memset(0)" with the corresponding "kmem_cache_zalloc()" call. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Andi Kleen <ak@muc.de> Cc: Roland McGrath <roland@redhat.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Greg KH <greg@kroah.com> Acked-by: Joel Becker <Joel.Becker@oracle.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Jan Kara <jack@ucw.cz> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Cc: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64/ia32')
-rw-r--r--arch/ia64/ia32/binfmt_elf32.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index 578737ec762..c05bda66236 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -91,9 +91,8 @@ ia64_elf32_init (struct pt_regs *regs)
91 * it with privilege level 3 because the IVE uses non-privileged accesses to these 91 * it with privilege level 3 because the IVE uses non-privileged accesses to these
92 * tables. IA-32 segmentation is used to protect against IA-32 accesses to them. 92 * tables. IA-32 segmentation is used to protect against IA-32 accesses to them.
93 */ 93 */
94 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 94 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
95 if (vma) { 95 if (vma) {
96 memset(vma, 0, sizeof(*vma));
97 vma->vm_mm = current->mm; 96 vma->vm_mm = current->mm;
98 vma->vm_start = IA32_GDT_OFFSET; 97 vma->vm_start = IA32_GDT_OFFSET;
99 vma->vm_end = vma->vm_start + PAGE_SIZE; 98 vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -117,9 +116,8 @@ ia64_elf32_init (struct pt_regs *regs)
117 * code is locked in specific gate page, which is pointed by pretcode 116 * code is locked in specific gate page, which is pointed by pretcode
118 * when setup_frame_ia32 117 * when setup_frame_ia32
119 */ 118 */
120 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 119 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
121 if (vma) { 120 if (vma) {
122 memset(vma, 0, sizeof(*vma));
123 vma->vm_mm = current->mm; 121 vma->vm_mm = current->mm;
124 vma->vm_start = IA32_GATE_OFFSET; 122 vma->vm_start = IA32_GATE_OFFSET;
125 vma->vm_end = vma->vm_start + PAGE_SIZE; 123 vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -142,9 +140,8 @@ ia64_elf32_init (struct pt_regs *regs)
142 * Install LDT as anonymous memory. This gives us all-zero segment descriptors 140 * Install LDT as anonymous memory. This gives us all-zero segment descriptors
143 * until a task modifies them via modify_ldt(). 141 * until a task modifies them via modify_ldt().
144 */ 142 */
145 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 143 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
146 if (vma) { 144 if (vma) {
147 memset(vma, 0, sizeof(*vma));
148 vma->vm_mm = current->mm; 145 vma->vm_mm = current->mm;
149 vma->vm_start = IA32_LDT_OFFSET; 146 vma->vm_start = IA32_LDT_OFFSET;
150 vma->vm_end = vma->vm_start + PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE); 147 vma->vm_end = vma->vm_start + PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE);
@@ -214,12 +211,10 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
214 bprm->loader += stack_base; 211 bprm->loader += stack_base;
215 bprm->exec += stack_base; 212 bprm->exec += stack_base;
216 213
217 mpnt = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); 214 mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
218 if (!mpnt) 215 if (!mpnt)
219 return -ENOMEM; 216 return -ENOMEM;
220 217
221 memset(mpnt, 0, sizeof(*mpnt));
222
223 down_write(&current->mm->mmap_sem); 218 down_write(&current->mm->mmap_sem);
224 { 219 {
225 mpnt->vm_mm = current->mm; 220 mpnt->vm_mm = current->mm;