From: Hidetoshi Seto Date: Fri, 20 Aug 2010 07:29:47 +0000 (-0300) Subject: i7core_edac: Check probe counter in i7core_remove X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~5423^2~11 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=71fe01706d631513bdbd73381f4b76dacea5cf77;p=mirror_ubuntu-zesty-kernel.git i7core_edac: Check probe counter in i7core_remove Prevent i7core_remove from running multiple times. Otherwise value proved will be negative and something will be wrong. Signed-off-by: Hidetoshi Seto Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 2e2db3c083ed..472fa375f1eb 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -2092,6 +2092,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)) {