Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126269
b: refs/heads/master
c: eaccbfa
h: refs/heads/master
i:
  126267: 4aed43f
v: v3
  • Loading branch information
Luiz Fernando N. Capitulino authored and Linus Torvalds committed Jan 6, 2009
1 parent feaf452 commit 8c8009c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bca1033b092a6fab2ed00036e8a7f6e2df5d99a2
refs/heads/master: eaccbfa564e48c87626594511f42dc8c0ad2daae
20 changes: 6 additions & 14 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos,

static int __bprm_mm_init(struct linux_binprm *bprm)
{
int err = -ENOMEM;
int err;
struct vm_area_struct *vma = NULL;
struct mm_struct *mm = bprm->mm;

bprm->vma = vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
if (!vma)
goto err;
return -ENOMEM;

down_write(&mm->mmap_sem);
vma->vm_mm = mm;
Expand All @@ -251,28 +251,20 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
*/
vma->vm_end = STACK_TOP_MAX;
vma->vm_start = vma->vm_end - PAGE_SIZE;

vma->vm_flags = VM_STACK_FLAGS;
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
err = insert_vm_struct(mm, vma);
if (err) {
up_write(&mm->mmap_sem);
if (err)
goto err;
}

mm->stack_vm = mm->total_vm = 1;
up_write(&mm->mmap_sem);

bprm->p = vma->vm_end - sizeof(void *);

return 0;

err:
if (vma) {
bprm->vma = NULL;
kmem_cache_free(vm_area_cachep, vma);
}

up_write(&mm->mmap_sem);
bprm->vma = NULL;
kmem_cache_free(vm_area_cachep, vma);
return err;
}

Expand Down

0 comments on commit 8c8009c

Please sign in to comment.