ANDROID: 16K: Duplicate command line for parsing page_shift
Using parse_args() on saved_command_line modifies it and results in
losing the original content. Duplicate the command line for parsing.
Fixes: ad60adea543b ("ANDROID: 16K: Init page_shift param in a pure_initcall()")
Bug: 380987371
Change-Id: I6998e465bbedc03c2e319bb27fb13b7dad666042
Signed-off-by: Jacky Liu <qsliu@google.com>
This commit is contained in:
@@ -54,10 +54,17 @@ static int __init page_shift_params(char *param, char *val,
|
||||
static int __init init_page_shift_compat(void)
|
||||
{
|
||||
char *err;
|
||||
char *command_line;
|
||||
|
||||
err = parse_args("page_shift", saved_command_line, NULL, 0, 0, 0, NULL,
|
||||
command_line = kstrdup(saved_command_line, GFP_KERNEL);
|
||||
if (!command_line)
|
||||
return -ENOMEM;
|
||||
|
||||
err = parse_args("page_shift", command_line, NULL, 0, 0, 0, NULL,
|
||||
page_shift_params);
|
||||
|
||||
kfree(command_line);
|
||||
|
||||
if (IS_ERR(err))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user