History

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()

Linus Torvalds committed 6 years ago

Commit 42df60f2 parents c401128 b972fdb1 file · +6 −4Browse files

Unified · Split

drivers/edac/ghes_edac.c+6−4
@@ -55,6 +55,8 @@ static DEFINE_SPINLOCK(ghes_lock); · 54 unmodified lines
55static bool __read_mostly force_load;55static bool __read_mostly force_load;
56module_param(force_load, bool, 0);56module_param(force_load, bool, 0);
57 57
58static bool system_scanned;
59
58/* Memory Device - Type 17 of SMBIOS spec */60/* Memory Device - Type 17 of SMBIOS spec */
59struct memdev_dmi_entry {61struct memdev_dmi_entry {
60 u8 type;62 u8 type;
@@ -225,14 +227,12 @@ static void enumerate_dimms(const struct dmi_header *dh, void *arg) · 164 unmodified lines
225 227
226static void ghes_scan_system(void)228static void ghes_scan_system(void)
227{229{
228 static bool scanned;230 if (system_scanned)
229
230 if (scanned)
231 return;231 return;
232 232
233 dmi_walk(enumerate_dimms, &ghes_hw);233 dmi_walk(enumerate_dimms, &ghes_hw);
234 234
235 scanned = true;235 system_scanned = true;
236}236}
237 237
238void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)238void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
@@ -631,6 +631,8 @@ void ghes_edac_unregister(struct ghes *ghes) · 392 unmodified lines
631 631
632 mutex_lock(&ghes_reg_mutex);632 mutex_lock(&ghes_reg_mutex);
633 633
634 system_scanned = false;
635
634 if (!refcount_dec_and_test(&ghes_refcount))636 if (!refcount_dec_and_test(&ghes_refcount))
635 goto unlock;637 goto unlock;
636 638

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t