From: Mauro Carvalho Chehab <mchehab@redhat.com> Date: Tue, 23 Nov 2010 17:33:57 -0500 Subject: [edac] i7core_edac: check probe counter in i7core_remove Message-id: <20101123153357.0d6a2cd9@pedra> Patchwork-id: 29574 O-Subject: [PATCH RHEL5 19/29] BZ#:651869 i7core_edac: Check probe counter in i7core_remove Bugzilla: 651869 RH-Acked-by: Aristeu Rozanski <aris@redhat.com> Changeset: 71fe01706d631513bdbd73381f4b76dacea5cf77 Prevent i7core_remove from running multiple times. Otherwise value proved will be negative and something will be wrong. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 5aa3ac9..e9f2a14 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -2082,6 +2082,12 @@ static void __devexit i7core_remove(struct pci_dev *pdev) */ mutex_lock(&i7core_edac_lock); + + if (unlikely(!probed)) { + mutex_unlock(&i7core_edac_lock); + return; + } + list_for_each_entry(i7core_dev, &i7core_edac_list, list) { mci = find_mci_by_dev(&i7core_dev->pdev[0]->dev); if (unlikely(!mci || !mci->pvt_info)) {