Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'edac_urgent_for_v5.9_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC fix from Borislav Petkov:
"A fix to properly clear ghes_edac driver state on driver remove so
that a subsequent load can probe the system properly (Shiju Jose)"

* tag 'edac_urgent_for_v5.9_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
EDAC/ghes: Fix NULL pointer dereference in ghes_edac_register()

+6 -4
+6 -4
drivers/edac/ghes_edac.c
··· 55 55 static bool __read_mostly force_load; 56 56 module_param(force_load, bool, 0); 57 57 58 + static bool system_scanned; 59 + 58 60 /* Memory Device - Type 17 of SMBIOS spec */ 59 61 struct memdev_dmi_entry { 60 62 u8 type; ··· 227 225 228 226 static void ghes_scan_system(void) 229 227 { 230 - static bool scanned; 231 - 232 - if (scanned) 228 + if (system_scanned) 233 229 return; 234 230 235 231 dmi_walk(enumerate_dimms, &ghes_hw); 236 232 237 - scanned = true; 233 + system_scanned = true; 238 234 } 239 235 240 236 void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) ··· 630 630 unsigned long flags; 631 631 632 632 mutex_lock(&ghes_reg_mutex); 633 + 634 + system_scanned = false; 633 635 634 636 if (!refcount_dec_and_test(&ghes_refcount)) 635 637 goto unlock;