]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
poweroff: fix bug in orderly_poweroff()
authorhongfeng <hongfeng@marvell.com>
Fri, 21 Sep 2012 01:01:56 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 21 Sep 2012 05:59:07 +0000 (15:59 +1000)
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 <hongfeng@marvell.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/sys.c

index 6fab59a1fc24d965e8c2e936d5e80e91e623592c..2a7d263e02bc165431215574997c9dc7c90d644f 100644 (file)
@@ -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);