aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/r82600_edac.c
diff options
context:
space:
mode:
authorDave Peterson <dsp@llnl.gov>2006-03-26 01:38:50 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 08:57:07 -0800
commit18dbc337af5d6efd30cb9291e74722c8ad134fd3 (patch)
tree10163d19960173d29deb7a9d931dfcdfe2188975 /drivers/edac/r82600_edac.c
parent472678ebd30d87cbe8d97562dcc0e46d1076040f (diff)
downloadkernel_samsung_smdk4412-18dbc337af5d6efd30cb9291e74722c8ad134fd3.zip
kernel_samsung_smdk4412-18dbc337af5d6efd30cb9291e74722c8ad134fd3.tar.gz
kernel_samsung_smdk4412-18dbc337af5d6efd30cb9291e74722c8ad134fd3.tar.bz2
[PATCH] EDAC: protect memory controller list
- Fix code so we always hold mem_ctls_mutex while we are stepping through the list of mem_ctl_info structures. Otherwise bad things may happen if one task is stepping through the list while another task is modifying it. We may eventually want to use reference counting to manage the mem_ctl_info structures. In the meantime we may as well fix this bug. - Don't disable interrupts while we are walking the list of mem_ctl_info structures in check_mc_devices(). This is unnecessary. Signed-off-by: David S. Peterson <dsp@llnl.gov> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/edac/r82600_edac.c')
-rw-r--r--drivers/edac/r82600_edac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index 787a765..5966916 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -353,9 +353,10 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
debugf0("%s()\n", __func__);
- if (((mci = edac_mc_find_mci_by_pdev(pdev)) != NULL) &&
- !edac_mc_del_mc(mci))
- edac_mc_free(mci);
+ if ((mci = edac_mc_del_mc(pdev)) == NULL)
+ return;
+
+ edac_mc_free(mci);
}