diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-08-08 12:57:15 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-08-08 12:57:15 +1000 |
commit | e846c95ba8d23c79df4b268d3c9a467b0b4eb76e (patch) | |
tree | 574e43ffba54ad2b1578e69f2656dad5eb6a4ee3 /fs/ext2/xattr_trusted.c | |
parent | d98c423594a2fba53cd5393e0648f49cf560efd3 (diff) |
exec: cleanup the error handling in search_binary_handler()
The error hanling and ret-from-loop look confusing and inconsistent.
- "retval >= 0" simply returns
- "!bprm->file" returns too but with read_unlock() because
binfmt_lock was already re-acquired
- "retval != -ENOEXEC || bprm->mm == NULL" does "break" and
relies on the same check after the main loop
Consolidate these checks into a single if/return statement.
need_retry still checks "retval == -ENOEXEC", but this and -ENOENT before
the main loop are not needed. This is only for pathological and
impossible list_empty(&formats) case.
It is not clear why do we check "bprm->mm == NULL", probably this
should be removed.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Zach Levis <zml@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/ext2/xattr_trusted.c')
0 files changed, 0 insertions, 0 deletions