Skip to content

Commit

Permalink
watchdog: iTCO_wdt.c: remove extra pci_dev_put()'s from init code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prarit Bhargava authored and Wim Van Sebroeck committed Oct 28, 2010
1 parent b63aa73 commit ad1d3a2
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/watchdog/iTCO_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
/* Something's wrong here, ACPIBASE has to be set */
printk(KERN_ERR PFX "failed to get TCOBASE address, "
"device disabled by hardware/BIOS\n");
pci_dev_put(pdev);
return -ENODEV;
}
iTCO_wdt_private.iTCO_version =
Expand Down Expand Up @@ -886,7 +885,6 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
if (iTCO_wdt_private.iTCO_version == 2)
iounmap(iTCO_wdt_private.gcs);
out:
pci_dev_put(iTCO_wdt_private.pdev);
iTCO_wdt_private.ACPIBASE = 0;
return ret;
}
Expand Down

0 comments on commit ad1d3a2

Please sign in to comment.