Skip to content

Commit

Permalink
exec: setup_arg_pages() fails to return errors
Browse files Browse the repository at this point in the history
In setup_arg_pages we work hard to assign a value to ret, but on exit we
always return 0.

Also remove a now duplicated exit path and branch to out_unlock instead.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
antonblanchard authored and torvalds committed Nov 12, 2009
1 parent 93f40e6 commit fc63cf2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,8 @@ int setup_arg_pages(struct linux_binprm *bprm,
/* Move stack pages down in memory. */
if (stack_shift) {
ret = shift_arg_pages(vma, stack_shift);
if (ret) {
up_write(&mm->mmap_sem);
return ret;
}
if (ret)
goto out_unlock;
}

#ifdef CONFIG_STACK_GROWSUP
Expand All @@ -641,7 +639,7 @@ int setup_arg_pages(struct linux_binprm *bprm,

out_unlock:
up_write(&mm->mmap_sem);
return 0;
return ret;
}
EXPORT_SYMBOL(setup_arg_pages);

Expand Down

0 comments on commit fc63cf2

Please sign in to comment.