diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2010-03-09 20:38:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 15:58:40 -0700 |
commit | ceb2ef9f7300353db873587c7fd6fc8ade79610e (patch) | |
tree | 909dc41188e52f23653d59ece1dcae9e3916ba43 | |
parent | a72fce06535457d953da1ee7d9ef9773c5925fd0 (diff) |
edac, mce: Filter out invalid values
commit 5b89d2f9ace1970324facc68ca9b8fae19ce8096 upstream.
Print the CPU associated with the error only when the field is valid.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/edac/edac_mce_amd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index 713ed7d3724..ac2aea8c756 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c @@ -311,9 +311,13 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) if (regs->nbsh & K8_NBSH_ERR_CPU_VAL) pr_cont(", core: %u\n", (u8)(regs->nbsh & 0xf)); } else { - pr_cont(", core: %d\n", ilog2((regs->nbsh & 0xf))); - } + u8 assoc_cpus = regs->nbsh & 0xf; + + if (assoc_cpus > 0) + pr_cont(", core: %d", fls(assoc_cpus) - 1); + pr_cont("\n"); + } pr_emerg("%s.\n", EXT_ERR_MSG(xec)); |