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>

authored by Anton Blanchard and committed by Linus Torvalds fc63cf23 93f40e6f

+3 -5
+3 -5
fs/exec.c
··· 624 /* Move stack pages down in memory. */ 625 if (stack_shift) { 626 ret = shift_arg_pages(vma, stack_shift); 627 - if (ret) { 628 - up_write(&mm->mmap_sem); 629 - return ret; 630 - } 631 } 632 633 #ifdef CONFIG_STACK_GROWSUP ··· 639 640 out_unlock: 641 up_write(&mm->mmap_sem); 642 - return 0; 643 } 644 EXPORT_SYMBOL(setup_arg_pages); 645
··· 624 /* Move stack pages down in memory. */ 625 if (stack_shift) { 626 ret = shift_arg_pages(vma, stack_shift); 627 + if (ret) 628 + goto out_unlock; 629 } 630 631 #ifdef CONFIG_STACK_GROWSUP ··· 641 642 out_unlock: 643 up_write(&mm->mmap_sem); 644 + return ret; 645 } 646 EXPORT_SYMBOL(setup_arg_pages); 647