|
@@ -143,11 +143,12 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
|
|
|
unsigned int *current_size)
|
|
|
{
|
|
|
struct microcode_header_amd *mc_hdr;
|
|
|
- unsigned int actual_size;
|
|
|
+ unsigned int actual_size, patch_size;
|
|
|
u16 equiv_cpu_id;
|
|
|
|
|
|
/* size of the current patch we're staring at */
|
|
|
- *current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
|
|
|
+ patch_size = *(u32 *)(ucode_ptr + 4);
|
|
|
+ *current_size = patch_size + SECTION_HDR_SIZE;
|
|
|
|
|
|
equiv_cpu_id = find_equiv_id();
|
|
|
if (!equiv_cpu_id)
|
|
@@ -174,7 +175,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
|
|
|
/*
|
|
|
* now that the header looks sane, verify its size
|
|
|
*/
|
|
|
- actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
|
|
|
+ actual_size = verify_ucode_size(cpu, patch_size, leftover_size);
|
|
|
if (!actual_size)
|
|
|
return 0;
|
|
|
|