lkml.org 
[lkml]   [2011]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:x86/microcode] x86, microcode, AMD: Fix signedness bug in generic_load_microcode()
    Commit-ID:  1396fa9cd2e34669253b7ca8c75f12103481f71c
    Gitweb: http://git.kernel.org/tip/1396fa9cd2e34669253b7ca8c75f12103481f71c
    Author: Dan Carpenter <error27@gmail.com>
    AuthorDate: Fri, 18 Feb 2011 12:17:16 +0300
    Committer: Ingo Molnar <mingo@elte.hu>
    CommitDate: Sun, 20 Feb 2011 14:01:32 +0100

    x86, microcode, AMD: Fix signedness bug in generic_load_microcode()

    install_equiv_cpu_table() returns type int. It uses negative
    error codes so using an unsigned type breaks the error handling.

    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Acked-by: Borislav Petkov <borislav.petkov@amd.com>
    Cc: open list:AMD MICROCODE UPD... <amd64-microcode@amd64.org>
    Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
    LKML-Reference: <20110218091716.GA4384@bicker>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    ---
    arch/x86/kernel/microcode_amd.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
    index 9fb8405..c561038 100644
    --- a/arch/x86/kernel/microcode_amd.c
    +++ b/arch/x86/kernel/microcode_amd.c
    @@ -246,7 +246,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
    struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
    struct microcode_header_amd *mc_hdr = NULL;
    unsigned int mc_size, leftover;
    - unsigned long offset;
    + int offset;
    const u8 *ucode_ptr = data;
    void *new_mc = NULL;
    unsigned int new_rev = uci->cpu_sig.rev;

    \
     
     \ /
      Last update: 2011-02-20 14:11    [W:0.025 / U:148.724 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site