diff options
author | Anton Blanchard <anton@samba.org> | 2009-11-11 17:26:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-12 10:25:58 -0500 |
commit | fc63cf237078c86214abcb2ee9926d8ad289da9b (patch) | |
tree | 3af8571390aec334b7f47c08ba0cff0a72d6fbb3 /fs/exec.c | |
parent | 93f40e6f1493ae0c1e04760b221c125ef5e47205 (diff) |
exec: setup_arg_pages() fails to return errors
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>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -624,10 +624,8 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
624 | /* Move stack pages down in memory. */ | 624 | /* Move stack pages down in memory. */ |
625 | if (stack_shift) { | 625 | if (stack_shift) { |
626 | ret = shift_arg_pages(vma, stack_shift); | 626 | ret = shift_arg_pages(vma, stack_shift); |
627 | if (ret) { | 627 | if (ret) |
628 | up_write(&mm->mmap_sem); | 628 | goto out_unlock; |
629 | return ret; | ||
630 | } | ||
631 | } | 629 | } |
632 | 630 | ||
633 | #ifdef CONFIG_STACK_GROWSUP | 631 | #ifdef CONFIG_STACK_GROWSUP |
@@ -641,7 +639,7 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
641 | 639 | ||
642 | out_unlock: | 640 | out_unlock: |
643 | up_write(&mm->mmap_sem); | 641 | up_write(&mm->mmap_sem); |
644 | return 0; | 642 | return ret; |
645 | } | 643 | } |
646 | EXPORT_SYMBOL(setup_arg_pages); | 644 | EXPORT_SYMBOL(setup_arg_pages); |
647 | 645 | ||