xen: Fix backport of "xen/cmdline: Fix buggy strncmp(s, LITERAL, ss - s) construct"
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 3 May 2019 08:52:32 +0000 (10:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 May 2019 08:52:32 +0000 (10:52 +0200)
These were missed as a consequence of being rebased over other cmdline
cleanup.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/dom0_build.c
xen/arch/x86/hvm/vmx/vmcs.c

index b744791c38793a2cb01b8c3164c0282532509b97..dbd7d0d393ca3fee2b296204da2b5a78317f90e8 100644 (file)
@@ -237,10 +237,10 @@ static int __init parse_dom0_param(const char *s)
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( !strncmp(s, "pvh", ss - s) )
+        if ( !cmdline_strcmp(s, "pvh") )
             dom0_pvh = true;
 #ifdef CONFIG_SHADOW_PAGING
-        else if ( !strncmp(s, "shadow", ss - s) )
+        else if ( !cmdline_strcmp(s, "shadow") )
             opt_dom0_shadow = true;
 #endif
         else
index 49c916b82da6ea4e0b598ed143e27011f2b05413..19755f27166a3d9e64f3135d66547522f4db49be 100644 (file)
@@ -90,9 +90,9 @@ static int __init parse_ept_param(const char *s)
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( !strncmp(s, "pml", ss - s) )
+        if ( !cmdline_strcmp(s, "pml") )
             opt_pml_enabled = val;
-        else if ( !strncmp(s, "ad", ss - s) )
+        else if ( !cmdline_strcmp(s, "ad") )
             opt_ept_ad = val;
         else
             rc = -EINVAL;