From 18dbc337af5d6efd30cb9291e74722c8ad134fd3 Mon Sep 17 00:00:00 2001 From: Dave Peterson Date: Sun, 26 Mar 2006 01:38:50 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/e7xxx_edac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/edac/e7xxx_edac.c') diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c index 8b0da35ae47c..9b59c661f45e 100644 --- a/drivers/edac/e7xxx_edac.c +++ b/drivers/edac/e7xxx_edac.c @@ -510,12 +510,12 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if (((mci = edac_mc_find_mci_by_pdev(pdev)) != 0) && - !edac_mc_del_mc(mci)) { - pvt = (struct e7xxx_pvt *) mci->pvt_info; - pci_dev_put(pvt->bridge_ck); - edac_mc_free(mci); - } + if ((mci = edac_mc_del_mc(pdev)) == NULL) + return; + + pvt = (struct e7xxx_pvt *) mci->pvt_info; + pci_dev_put(pvt->bridge_ck); + edac_mc_free(mci); } -- cgit v1.2.3