x86, microcode, AMD: Fix signedness bug in generic_load_microcode()
authorDan Carpenter <error27@gmail.com>
Fri, 18 Feb 2011 09:17:16 +0000 (12:17 +0300)
committerIngo Molnar <mingo@elte.hu>
Sun, 20 Feb 2011 13:01:32 +0000 (14:01 +0100)
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

index 9fb8405451c58eea24e6d005f3cab64ea2e2ac98..c5610384ab167c162f33abbb6da8401b5cbba45d 100644 (file)
@@ -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;