aboutsummaryrefslogtreecommitdiff
path: root/drivers/edac
diff options
context:
space:
mode:
authorWei Yongjun2013-02-26 16:39:14 +0800
committerMauro Carvalho Chehab2013-02-26 10:05:35 -0300
commit5dae92a718570e6a942e0b882e53d25cab03b40f (patch)
tree45b3f34949a88cc223cc71bd7c69d774edcdfcee /drivers/edac
parent8ae8f50ad8979bb670598ff92eebea611b799f10 (diff)
ghes_edac: fix to use list_for_each_entry_safe() when delete list items
Since we will remove items off the list using list_del() we need to use a safe version of the list_for_each_entry() macro aptly named list_for_each_entry_safe(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/ghes_edac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index 636dcf18d5b6..bb534670ec02 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -523,9 +523,9 @@ EXPORT_SYMBOL_GPL(ghes_edac_register);
void ghes_edac_unregister(struct ghes *ghes)
{
struct mem_ctl_info *mci;
- struct ghes_edac_pvt *pvt;
+ struct ghes_edac_pvt *pvt, *tmp;
- list_for_each_entry(pvt, &ghes_reglist, list) {
+ list_for_each_entry_safe(pvt, tmp, &ghes_reglist, list) {
if (ghes == pvt->ghes) {
mci = pvt->mci;
edac_mc_del_mc(mci->pdev);