diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/ia32/syscall32.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c index 01d8db1a1c09..816a3b89f13d 100644 --- a/arch/x86_64/ia32/syscall32.c +++ b/arch/x86_64/ia32/syscall32.c | |||
@@ -57,6 +57,7 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) | |||
57 | int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT; | 57 | int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT; |
58 | struct vm_area_struct *vma; | 58 | struct vm_area_struct *vma; |
59 | struct mm_struct *mm = current->mm; | 59 | struct mm_struct *mm = current->mm; |
60 | int ret; | ||
60 | 61 | ||
61 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 62 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); |
62 | if (!vma) | 63 | if (!vma) |
@@ -78,7 +79,11 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) | |||
78 | vma->vm_mm = mm; | 79 | vma->vm_mm = mm; |
79 | 80 | ||
80 | down_write(&mm->mmap_sem); | 81 | down_write(&mm->mmap_sem); |
81 | insert_vm_struct(mm, vma); | 82 | if ((ret = insert_vm_struct(mm, vma))) { |
83 | up_write(&mm->mmap_sem); | ||
84 | kmem_cache_free(vm_area_cachep, vma); | ||
85 | return ret; | ||
86 | } | ||
82 | mm->total_vm += npages; | 87 | mm->total_vm += npages; |
83 | up_write(&mm->mmap_sem); | 88 | up_write(&mm->mmap_sem); |
84 | return 0; | 89 | return 0; |