Skip to content

Commit aac5925

Browse files
committed
Merge tag 'edac_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC fixes from Borislav Petkov: "Two fixes for resulting from CONFIG_DEBUG_TEST_DRIVER_REMOVE=y experiments: - complete a previous fix to reset a local structure containing scanned system data properly so that the driver rescans, as it should, on a second load. - address a refcount underflow due to not paying attention to the driver whitelest on unregister" * tag 'edac_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/ghes: Check whether the driver is on the safe list correctly EDAC/ghes: Clear scanned data on unload
2 parents 376566c + 251c54e commit aac5925

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/edac/ghes_edac.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
508508
if (!force_load && idx < 0)
509509
return -ENODEV;
510510
} else {
511+
force_load = true;
511512
idx = 0;
512513
}
513514

@@ -629,9 +630,13 @@ void ghes_edac_unregister(struct ghes *ghes)
629630
struct mem_ctl_info *mci;
630631
unsigned long flags;
631632

633+
if (!force_load)
634+
return;
635+
632636
mutex_lock(&ghes_reg_mutex);
633637

634638
system_scanned = false;
639+
memset(&ghes_hw, 0, sizeof(struct ghes_hw_desc));
635640

636641
if (!refcount_dec_and_test(&ghes_refcount))
637642
goto unlock;

0 commit comments

Comments
 (0)