]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
cmdline: only set ask mode if vga= is present
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 10 Jul 2023 16:35:09 +0000 (18:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 10 Jul 2023 16:35:09 +0000 (18:35 +0200)
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é <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/cmdline.c

index 10dcc6142c857565e0da678af91a64e877661442..74997703b31ee2cfa85e37843ce61e2974584dcc 100644 (file)
@@ -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