Commit c7957020 authored by Borislav Petkov's avatar Borislav Petkov

x86/microcode/AMD: Move chipset-specific check into verify_patch()

... where it belongs.

No functional changes.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: x86@kernel.org
https://lkml.kernel.org/r/20181107170218.7596-10-bp@alien8.de
parent 51776fb8
...@@ -249,6 +249,12 @@ verify_patch(u8 family, const u8 *buf, unsigned int buf_size, bool early) ...@@ -249,6 +249,12 @@ verify_patch(u8 family, const u8 *buf, unsigned int buf_size, bool early)
mc_hdr = (struct microcode_header_amd *)(buf + SECTION_HDR_SIZE); mc_hdr = (struct microcode_header_amd *)(buf + SECTION_HDR_SIZE);
proc_id = mc_hdr->processor_rev_id; proc_id = mc_hdr->processor_rev_id;
if (mc_hdr->nb_dev_id || mc_hdr->sb_dev_id) {
if (!early)
pr_err("Patch-ID 0x%08x: chipset-specific code unsupported.\n", mc_hdr->patch_id);
return 0;
}
patch_fam = 0xf + (proc_id >> 12); patch_fam = 0xf + (proc_id >> 12);
if (patch_fam != family) if (patch_fam != family)
return 0; return 0;
...@@ -741,12 +747,6 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover) ...@@ -741,12 +747,6 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover)
mc_hdr = (struct microcode_header_amd *)(fw + SECTION_HDR_SIZE); mc_hdr = (struct microcode_header_amd *)(fw + SECTION_HDR_SIZE);
proc_id = mc_hdr->processor_rev_id; proc_id = mc_hdr->processor_rev_id;
if (mc_hdr->nb_dev_id || mc_hdr->sb_dev_id) {
pr_err("Patch-ID 0x%08x: chipset-specific code unsupported.\n",
mc_hdr->patch_id);
return crnt_size;
}
patch = kzalloc(sizeof(*patch), GFP_KERNEL); patch = kzalloc(sizeof(*patch), GFP_KERNEL);
if (!patch) { if (!patch) {
pr_err("Patch allocation failure.\n"); pr_err("Patch allocation failure.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment