From: Takuya Yoshikawa Date: Tue, 1 Jun 2010 13:10:47 +0000 (+0100) Subject: binfmt_elf_fdpic: Fix clear_user() error handling X-Git-Tag: v2.6.35-rc2~65 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e30c7c3b306312c157d67eedd6a01920518b756c;p=pandora-kernel.git binfmt_elf_fdpic: Fix clear_user() error handling clear_user() returns the number of bytes that could not be copied rather than an error code. So we should return -EFAULT rather than directly returning the results. Without this patch, positive values may be returned to elf_fdpic_map_file() and the following error handlings do not function as expected. 1. ret = elf_fdpic_map_file_constdisp_on_uclinux(params, file, mm); if (ret < 0) return ret; 2. ret = elf_fdpic_map_file_by_direct_mmap(params, file, mm); if (ret < 0) return ret; Signed-off-by: Takuya Yoshikawa Signed-off-by: David Howells Acked-by: Mike Frysinger CC: Alexander Viro CC: Andrew Morton CC: Daisuke HATAYAMA CC: Paul Mundt Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed