exec: cleanup the CONFIG_MODULES logic
authorOleg Nesterov <[email protected]>
Wed, 11 Sep 2013 21:24:44 +0000 (14:24 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Sep 2013 22:59:05 +0000 (15:59 -0700)
commitcb7b6b1cbc20a970c7124efae1c2478155604b54
treeef0e867017f0a6fea23ebdcd87753174a4c75a25
parent92eaa565add62d56b90987f58ea9feafc5a7c183
exec: cleanup the CONFIG_MODULES logic

search_binary_handler() uses "for (try=0; try<2; try++)" to avoid "goto"
but the code looks too complicated and horrible imho.  We still need to
check "try == 0" before request_module() and add the additional "break"
for !CONFIG_MODULES case.

Kill this loop and use a simple "bool need_retry" + "goto retry".  The
code looks much simpler and we do not even need ifdef's, gcc can optimize
out the "if (need_retry)" block if !IS_ENABLED().

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Evgeniy Polyakov <[email protected]>
Cc: Zach Levis <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/exec.c