Skip to content

Commit

Permalink
ghes_edac: fix to use list_for_each_entry_safe() when delete list items
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Mauro Carvalho Chehab committed Feb 26, 2013
1 parent 8ae8f50 commit 5dae92a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/edac/ghes_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5dae92a

Please sign in to comment.