Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113340
b: refs/heads/master
c: d473879
h: refs/heads/master
v: v3
  • Loading branch information
Peter Oruba authored and Ingo Molnar committed Sep 23, 2008
1 parent 0197163 commit 3bfa445
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6cffde1a20409f9720d5c9aba28d3efd3a4f04e
refs/heads/master: d4738792fb86600b6cb7220459d9c47e819b3580
17 changes: 8 additions & 9 deletions trunk/arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,20 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
unsigned int *mc_size)
{
unsigned int total_size;
#define UCODE_UNKNOWN_HDR 8
u8 hdr[UCODE_UNKNOWN_HDR];
#define UCODE_CONTAINER_SECTION_HDR 8
u8 section_hdr[UCODE_CONTAINER_SECTION_HDR];
void *mc;

if (get_ucode_data(hdr, buf, UCODE_UNKNOWN_HDR))
if (get_ucode_data(section_hdr, buf, UCODE_CONTAINER_SECTION_HDR))
return NULL;

if (hdr[0] != UCODE_UCODE_TYPE) {
if (section_hdr[0] != UCODE_UCODE_TYPE) {
printk(KERN_ERR "microcode: error! "
"Wrong microcode payload type field\n");
return NULL;
}

/* FIXME! dimm: Why not by means of get_totalsize(hdr)? */
total_size = (unsigned long) (hdr[4] + (hdr[5] << 8));
total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));

printk(KERN_INFO "microcode: size %u, total_size %u\n",
size, total_size);
Expand All @@ -290,13 +289,13 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
mc = vmalloc(UCODE_MAX_SIZE);
if (mc) {
memset(mc, 0, UCODE_MAX_SIZE);
if (get_ucode_data(mc, buf + UCODE_UNKNOWN_HDR, total_size)) {
if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) {
vfree(mc);
mc = NULL;
} else
*mc_size = total_size + UCODE_UNKNOWN_HDR;
*mc_size = total_size + UCODE_CONTAINER_SECTION_HDR;
}
#undef UCODE_UNKNOWN_HDR
#undef UCODE_CONTAINER_SECTION_HDR
return mc;
}

Expand Down

0 comments on commit 3bfa445

Please sign in to comment.