From: Borislav Petkov Date: Tue, 9 Mar 2010 19:38:48 +0000 (+0100) Subject: edac, mce: Filter out invalid values X-Git-Tag: v2.6.33.2~76 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5e3efc9e49c8ecb6b1eaf4244ad7ce9f96aed2e5;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index 8fc91a019620..f5b6d9fe4def 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c @@ -316,7 +316,12 @@ 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", fls((regs->nbsh & 0xf) - 1)); + 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));