[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/ucode: Don't try to cope with NULL pointers in apply_microcode()



commit 4853f03dee2ed17cc421260d669377db253f0dac
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Apr 1 22:45:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Apr 3 20:11:46 2020 +0100

    x86/ucode: Don't try to cope with NULL pointers in apply_microcode()
    
    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@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/cpu/microcode/amd.c   | 3 ---
 xen/arch/x86/cpu/microcode/intel.c | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index c9656de55d..0ca0e9a038 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -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;
 
diff --git a/xen/arch/x86/cpu/microcode/intel.c 
b/xen/arch/x86/cpu/microcode/intel.c
index 315fca9ff2..9cb077b583 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.