summaryrefslogtreecommitdiff
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-08-11 23:40:15 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-24 11:20:37 -0200
commit39300e7143f8ef81b07cee3d8b86880bc4311ea0 (patch)
tree7f96fd808cd9046e9038575515ab68531a109538 /drivers/edac
parent41ba6c10586dfab632725cd532677ae5ae460e3e (diff)
i7core_edac: explicitly remove PCI devices from the devices list
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7core_edac.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index e5aa06e6389e..11c61b4d8149 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1240,16 +1240,17 @@ static void i7core_put_devices(struct i7core_dev *i7core_dev)
pci_dev_put(pdev);
}
kfree(i7core_dev->pdev);
- list_del(&i7core_dev->list);
- kfree(i7core_dev);
}
static void i7core_put_all_devices(void)
{
struct i7core_dev *i7core_dev, *tmp;
- list_for_each_entry_safe(i7core_dev, tmp, &i7core_edac_list, list)
+ list_for_each_entry_safe(i7core_dev, tmp, &i7core_edac_list, list) {
i7core_put_devices(i7core_dev);
+ list_del(&i7core_dev->list);
+ kfree(i7core_dev);
+ }
}
static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)
@@ -1438,7 +1439,6 @@ static int i7core_get_devices(const struct pci_id_table *table)
}
return 0;
- return 0;
}
static int mci_bind_devs(struct mem_ctl_info *mci,
@@ -2092,6 +2092,8 @@ static void __devexit i7core_remove(struct pci_dev *pdev)
/* Release PCI resources */
i7core_put_devices(i7core_dev);
}
+ list_del(&i7core_dev->list);
+ kfree(i7core_dev);
}
probed--;