Commit 7422c581 authored by Yazen Ghannam's avatar Yazen Ghannam Committed by Greg Kroah-Hartman

EDAC, amd64: Add x86cpuid sanity check during init

[ Upstream commit 1bd9900b ]

Match one of the devices in amd64_cpuids[] before loading the module.
This is an additional sanity check against users trying to load
amd64_edac_mod on unsupported systems.
Signed-off-by: default avatarYazen Ghannam <>
Cc: linux-edac <>
[ Get rid of err_ret label, make it a bit more readable this way. ]
Signed-off-by: default avatarBorislav Petkov <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2f945e74
......@@ -2984,8 +2984,11 @@ static int __init amd64_edac_init(void)
int err = -ENODEV;
int i;
if (!x86_match_cpu(amd64_cpuids))
return -ENODEV;
if (amd_cache_northbridges() < 0)
goto err_ret;
return -ENODEV;
......@@ -3025,7 +3028,6 @@ err_free:
ecc_stngs = NULL;
return err;
......@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/mmzone.h>
#include <linux/edac.h>
#include <asm/cpu_device_id.h>
#include <asm/msr.h>
#include "edac_core.h"
#include "mce_amd.h"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment