From e6f4e4aa6f8dafd2aae8d2a214de8320490f1246 Mon Sep 17 00:00:00 2001 From: mahj8 Date: Fri, 12 Mar 2021 18:22:40 +0800 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1899604 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- kernel/umh.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/umh.c b/kernel/umh.c index b8c524dcc76f..f601857fa9b1 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -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;