Skip to content

Commit

Permalink
x86, microcode, AMD: Fix signedness bug in generic_load_microcode()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Ingo Molnar committed Feb 20, 2011
1 parent 44d60c0 commit 1396fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1396fa9

Please sign in to comment.