]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/ucode: Don't try to cope with NULL pointers in apply_microcode()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Apr 2020 21:45:22 +0000 (22:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 3 Apr 2020 19:11:46 +0000 (20:11 +0100)
No paths to apply_microcode() pass a NULL pointer, and other hooks don't
tolerate one in the first place.  We can expect the core logic not to pass us
junk, so drop the checks.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/microcode/amd.c
xen/arch/x86/cpu/microcode/intel.c

index c9656de55db405fb76af03af5d8028f4d9ed88df..0ca0e9a038e46b2d55b99fd7df9f8263b01444c8 100644 (file)
@@ -219,9 +219,6 @@ static int apply_microcode(const struct microcode_patch *patch)
     struct cpu_signature *sig = &per_cpu(cpu_sig, cpu);
     uint32_t rev, old_rev = sig->rev;
 
-    if ( !patch )
-        return -ENOENT;
-
     if ( microcode_fits(patch) != NEW_UCODE )
         return -EINVAL;
 
index 315fca9ff20560b898bf178fbdcb9b5225052284..9cb077b583f61eced7b1714db82e5a84ce81a5e6 100644 (file)
@@ -270,9 +270,6 @@ static int apply_microcode(const struct microcode_patch *patch)
     struct cpu_signature *sig = &this_cpu(cpu_sig);
     uint32_t rev, old_rev = sig->rev;
 
-    if ( !patch )
-        return -ENOENT;
-
     if ( microcode_update_match(patch) != NEW_UCODE )
         return -EINVAL;