kernel: unit power off failed when removed charger

unit power off failed when removed charger in factory mode.
Because google android R define CONFIG_STATIC_USERMODEHELPER
and CONFIG_STATIC_USERMODEHELPER_PATH = "", so sub_info->path
is always empty.

Change-Id: If06b3a52e657e083ce89f2f75f717c753a57d685
Signed-off-by: mahj8 <mahj8@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1899604
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
mahj8 2021-03-12 18:22:40 +08:00 • committed by Xiaojun Ji
commit e6f4e4aa6f

View file

@ -403,6 +403,10 @@ struct subprocess_info *call_usermodehelper_setup(const char *path, char **argv,
#else
sub_info->path = path;
#endif
if ((path != NULL) && !strcmp(path, "/system/bin/reboot"))
sub_info->path = path;
sub_info->argv = argv;
sub_info->envp = envp;