diff options
| author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-06 19:48:59 -0400 |
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-06 19:48:59 -0400 |
| commit | fff34b3412b9401a76ba9d021db1bd91cb0e02b6 (patch) | |
| tree | 870ed2d1555004e7939d15b5099017aae61c97b8 /arch/x86/kernel/microcode_amd.c | |
| parent | 28e1e58fb668e262648fb8ee8a24154633f40507 (diff) | |
| parent | 636802ef96eebe279b22ad9f9dacfe29291e45c7 (diff) | |
Merge branch 'merge' into next
Brings in various bug fixes from 3.6-rcX
Diffstat (limited to 'arch/x86/kernel/microcode_amd.c')
| -rw-r--r-- | arch/x86/kernel/microcode_amd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 8a2ce8fd41c0..82746f942cd8 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
| @@ -143,11 +143,12 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr, | |||
| 143 | unsigned int *current_size) | 143 | unsigned int *current_size) |
| 144 | { | 144 | { |
| 145 | struct microcode_header_amd *mc_hdr; | 145 | struct microcode_header_amd *mc_hdr; |
| 146 | unsigned int actual_size; | 146 | unsigned int actual_size, patch_size; |
| 147 | u16 equiv_cpu_id; | 147 | u16 equiv_cpu_id; |
| 148 | 148 | ||
| 149 | /* size of the current patch we're staring at */ | 149 | /* size of the current patch we're staring at */ |
| 150 | *current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE; | 150 | patch_size = *(u32 *)(ucode_ptr + 4); |
| 151 | *current_size = patch_size + SECTION_HDR_SIZE; | ||
| 151 | 152 | ||
| 152 | equiv_cpu_id = find_equiv_id(); | 153 | equiv_cpu_id = find_equiv_id(); |
| 153 | if (!equiv_cpu_id) | 154 | if (!equiv_cpu_id) |
| @@ -174,7 +175,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr, | |||
| 174 | /* | 175 | /* |
| 175 | * now that the header looks sane, verify its size | 176 | * now that the header looks sane, verify its size |
| 176 | */ | 177 | */ |
| 177 | actual_size = verify_ucode_size(cpu, *current_size, leftover_size); | 178 | actual_size = verify_ucode_size(cpu, patch_size, leftover_size); |
| 178 | if (!actual_size) | 179 | if (!actual_size) |
| 179 | return 0; | 180 | return 0; |
| 180 | 181 | ||
