poweroff: fix bug in orderly_poweroff
PATCH v2 1/1 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.
Change-Id I2f9ebbb90c0c2443780080ec9507c8d004e5da74
Signed-off-by Feng Hong <[email protected]>
--- kernel/sys.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sys.c +1 -1
@@ -2204,7 +2204,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);
Signature · 1 line
1.7.0.4