aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/iTCO_wdt.c
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2010-10-27 09:50:22 -0400
committerWim Van Sebroeck <wim@iguana.be>2010-10-28 18:34:37 -0400
commitad1d3a26cdb9a0eaa0bf8351a000df0f256b0baa (patch)
tree5100819a67970274c4d3f2b928f05c32d51811b2 /drivers/watchdog/iTCO_wdt.c
parentb63aa731cd9e3fed7694a99f9c233f5f4b244f03 (diff)
watchdog: iTCO_wdt.c: remove extra pci_dev_put()'s from init code
The iTCO_wdt driver erroneously releases the pci_dev, and causes PCI hotremove to fail because of an incorrect usage count. The probe for this driver does a for_each_pci_dev() which gets a reference for a pci_dev when iTCO_wdt_init() is successful. The for_each_pci_dev() loop puts a reference for a pci_dev when iTCO_wdt_init() fails, so the iTCO_wdt_init() does not need to do any pci_dev_put()'s. The only pci_dev_put() that is required is in the iTCO_wdt_cleanup() function. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/iTCO_wdt.c')
-rw-r--r--drivers/watchdog/iTCO_wdt.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index bc69731a5e6a..f7e90fe47b71 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -786,7 +786,6 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
786 /* Something's wrong here, ACPIBASE has to be set */ 786 /* Something's wrong here, ACPIBASE has to be set */
787 printk(KERN_ERR PFX "failed to get TCOBASE address, " 787 printk(KERN_ERR PFX "failed to get TCOBASE address, "
788 "device disabled by hardware/BIOS\n"); 788 "device disabled by hardware/BIOS\n");
789 pci_dev_put(pdev);
790 return -ENODEV; 789 return -ENODEV;
791 } 790 }
792 iTCO_wdt_private.iTCO_version = 791 iTCO_wdt_private.iTCO_version =
@@ -886,7 +885,6 @@ out_unmap:
886 if (iTCO_wdt_private.iTCO_version == 2) 885 if (iTCO_wdt_private.iTCO_version == 2)
887 iounmap(iTCO_wdt_private.gcs); 886 iounmap(iTCO_wdt_private.gcs);
888out: 887out:
889 pci_dev_put(iTCO_wdt_private.pdev);
890 iTCO_wdt_private.ACPIBASE = 0; 888 iTCO_wdt_private.ACPIBASE = 0;
891 return ret; 889 return ret;
892} 890}