xen/arch/x86/microcode.c: let custom parameter parsing routines return errno
authorJuergen Gross <jgross@suse.com>
Wed, 23 Aug 2017 17:34:00 +0000 (19:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Aug 2017 14:15:56 +0000 (16:15 +0200)
Modify the custom parameter parsing routines in:

xen/arch/x86/microcode.c

to indicate whether the parameter value was parsed successfully.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/microcode.c

index 7558202efa7249a6b903db140adca73401cfc083..77c1efc97f9684208fd6c0470f98b15e709d4097 100644 (file)
@@ -73,15 +73,19 @@ void __init microcode_set_module(unsigned int idx)
  * If the EFI has forced which of the multiboot payloads is to be used,
  * no parsing will be attempted.
  */
-static void __init parse_ucode(char *s)
+static int __init parse_ucode(const char *s)
 {
+    const char *q = NULL;
+
     if ( ucode_mod_forced ) /* Forced by EFI */
-       return;
+       return 0;
 
     if ( !strncmp(s, "scan", 4) )
         ucode_scan = 1;
     else
-        ucode_mod_idx = simple_strtol(s, NULL, 0);
+        ucode_mod_idx = simple_strtol(s, &q, 0);
+
+    return (q && *q) ? -EINVAL : 0;
 }
 custom_param("ucode", parse_ucode);