From b831326ee2f9ed94523b3d8b0fb2da2a82113e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Date: Mon, 10 Jul 2023 18:35:09 +0200 Subject: [PATCH] cmdline: only set ask mode if vga= is present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 9473d9a24182 set the ASK mode without checking if there was a `vga` option provided in the command line. This breaks existing behavior, so exit early without changes if `vga` is not present in the command line. Fixes: 9473d9a24182 ('cmdline: parse multiple instances of the vga option') Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- xen/arch/x86/boot/cmdline.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c index 10dcc6142c..74997703b3 100644 --- a/xen/arch/x86/boot/cmdline.c +++ b/xen/arch/x86/boot/cmdline.c @@ -279,9 +279,13 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) { const char *c = cmdline; + c = find_opt(c, "vga=", true); + if ( !c ) + return; + ebo->boot_vid_mode = ASK_VGA; - while ( (c = find_opt(c, "vga=", true)) != NULL ) + do { unsigned int tmp, vesa_depth, vesa_height, vesa_width; @@ -332,6 +336,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo) else if ( !strmaxcmp(c, "ask", delim_chars_comma) ) ebo->boot_vid_mode = ASK_VGA; } + while ( (c = find_opt(c, "vga=", true)) != NULL ); } #endif