Skip to content

Commit

Permalink
Merge tag 'edac_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Sep 20, 2020
2 parents 376566c + 251c54e commit aac5925
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/edac/ghes_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
if (!force_load && idx < 0)
return -ENODEV;
} else {
force_load = true;
idx = 0;
}

Expand Down Expand Up @@ -629,9 +630,13 @@ void ghes_edac_unregister(struct ghes *ghes)
struct mem_ctl_info *mci;
unsigned long flags;

if (!force_load)
return;

mutex_lock(&ghes_reg_mutex);

system_scanned = false;
memset(&ghes_hw, 0, sizeof(struct ghes_hw_desc));

if (!refcount_dec_and_test(&ghes_refcount))
goto unlock;
Expand Down

0 comments on commit aac5925

Please sign in to comment.