public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FIX CONFIG_CMDLINE is not avail when kernel config line in grub ends with --
@ 2022-06-30  4:38 hmy
  2022-06-30 12:29 ` kernel test robot
  2022-07-17 11:07 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: hmy @ 2022-06-30  4:38 UTC (permalink / raw)
  To: robh+dt; +Cc: linux-kernel, hmy

when boot_command_line = grub-command "--" CONFIG_CMDLINE,
    parse_args() will exit and without parsing the contents of CONFIG_CMDLINE

Signed-off-by: hmy <huanglin@uniontech.com>
---
 drivers/of/fdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index a8f5b6532165..696dc4179944 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1160,6 +1160,7 @@ int __init early_init_dt_scan_chosen(char *cmdline)
 {
 	int l, node;
 	const char *p;
+	char *q;
 	const void *rng_seed;
 	const void *fdt = initial_boot_params;
 
@@ -1188,6 +1189,9 @@ int __init early_init_dt_scan_chosen(char *cmdline)
 #if defined(CONFIG_CMDLINE_EXTEND)
 	strlcat(cmdline, " ", COMMAND_LINE_SIZE);
 	strlcat(cmdline, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+	q = strstr(data, "--");
+	if (q)
+		*q = '\0';
 #elif defined(CONFIG_CMDLINE_FORCE)
 	strlcpy(cmdline, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
 #else
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-17 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30  4:38 [PATCH] FIX CONFIG_CMDLINE is not avail when kernel config line in grub ends with -- hmy
2022-06-30 12:29 ` kernel test robot
2022-07-17 11:07 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox