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>
This commit is contained in:
Wei Yongjun 2013-02-26 16:39:14 +08:00 коммит произвёл Mauro Carvalho Chehab
Родитель 8ae8f50ad8
Коммит 5dae92a718
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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);