From: hongfeng Date: Fri, 21 Sep 2012 01:01:56 +0000 (+1000) Subject: poweroff: fix bug in orderly_poweroff() X-Git-Tag: next-20120921~6^2~147 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=848e67c0efa8a510f4527179b8fb201381af19e7;p=karo-tx-linux.git poweroff: fix bug in orderly_poweroff() orderly_poweroff is trying to poweroff platform by two steps: step 1: Call userspace application to poweroff step 2: If userspace poweroff fail, then do a force power off if force param is set. The bug here is, step 1 is always successful with param UMH_NO_WAIT, should change to UMH_WAIT_EXEC which will monitor whether user application successful run. Signed-off-by: Feng Hong Acked-by: Kees Cook Cc: Serge Hallyn Cc: "Eric W. Biederman" Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton --- diff --git a/kernel/sys.c b/kernel/sys.c index 6fab59a1fc24..2a7d263e02bc 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2205,7 +2205,7 @@ static int __orderly_poweroff(void) return -ENOMEM; } - ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT, + ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_WAIT_EXEC, NULL, argv_cleanup, NULL); if (ret == -ENOMEM) argv_free(argv);