EDAC/skx_common: Filter out the invalid address
[linux-2.6-microblaze.git] / drivers / edac / skx_common.c
index ce3e006..9c5b6f8 100644 (file)
@@ -648,6 +648,10 @@ int skx_mce_check_error(struct notifier_block *nb, unsigned long val,
        memset(&res, 0, sizeof(res));
        res.mce  = mce;
        res.addr = mce->addr & MCI_ADDR_PHYSADDR;
+       if (!pfn_to_online_page(res.addr >> PAGE_SHIFT)) {
+               pr_err("Invalid address 0x%llx in IA32_MC%d_ADDR\n", mce->addr, mce->bank);
+               return NOTIFY_DONE;
+       }
 
        /* Try driver decoder first */
        if (!(driver_decode && driver_decode(&res))) {