diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-16 02:46:15 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-16 02:46:15 -0400 |
commit | c5f977a0d2d6a8f02f32139b5dd129e52073f38f (patch) | |
tree | 82180b8f21992312ad78becf759f21b9110e72ca /arch/ppc64/kernel/vdso.c | |
parent | f3d242e8f2bf12cb45eb35b7d2e69483d1209b13 (diff) | |
parent | 065d9cac98a5406ecd5a1368f8fd38f55739dee9 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'arch/ppc64/kernel/vdso.c')
-rw-r--r-- | arch/ppc64/kernel/vdso.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/ppc64/kernel/vdso.c b/arch/ppc64/kernel/vdso.c index 4777676365f..efa985f05ac 100644 --- a/arch/ppc64/kernel/vdso.c +++ b/arch/ppc64/kernel/vdso.c @@ -224,10 +224,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); if (vma == NULL) return -ENOMEM; - if (security_vm_enough_memory(vdso_pages)) { - kmem_cache_free(vm_area_cachep, vma); - return -ENOMEM; - } + memset(vma, 0, sizeof(*vma)); /* @@ -237,8 +234,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) */ vdso_base = get_unmapped_area(NULL, vdso_base, vdso_pages << PAGE_SHIFT, 0, 0); - if (vdso_base & ~PAGE_MASK) + if (vdso_base & ~PAGE_MASK) { + kmem_cache_free(vm_area_cachep, vma); return (int)vdso_base; + } current->thread.vdso_base = vdso_base; @@ -266,7 +265,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) vma->vm_ops = &vdso_vmops; down_write(&mm->mmap_sem); - insert_vm_struct(mm, vma); + if (insert_vm_struct(mm, vma)) { + up_write(&mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return -ENOMEM; + } mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; up_write(&mm->mmap_sem); |