diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2006-07-19 16:39:13 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2006-10-03 15:34:56 -0400 |
commit | 4802c6533af3223f43b9e4a1bb8a2a1c51f398b1 (patch) | |
tree | 374cdecc2395e01bbc1ae55bf99a70feb52c9e0c /drivers/char | |
parent | 3836cc0ff8c875e21a8119e7a4f0227f6e227650 (diff) |
[WATCHDOG] iTCO_wdt.c - pci_dev_put fix
for_each_pci_dev calls pci_get_device (and thus
it calls pci_dev_get). So we need to do a pci_dev_put
to keep the refcounting correct.
(Thanks to Jiri Slaby <jirislaby@gmail.com>)
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/watchdog/iTCO_wdt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c index cbdfbf00cfb7..852ad8389bc7 100644 --- a/drivers/char/watchdog/iTCO_wdt.c +++ b/drivers/char/watchdog/iTCO_wdt.c | |||
@@ -45,7 +45,7 @@ | |||
45 | /* Module and version information */ | 45 | /* Module and version information */ |
46 | #define DRV_NAME "iTCO_wdt" | 46 | #define DRV_NAME "iTCO_wdt" |
47 | #define DRV_VERSION "1.00" | 47 | #define DRV_VERSION "1.00" |
48 | #define DRV_RELDATE "18-Jun-2006" | 48 | #define DRV_RELDATE "19-Jul-2006" |
49 | #define PFX DRV_NAME ": " | 49 | #define PFX DRV_NAME ": " |
50 | 50 | ||
51 | /* Includes */ | 51 | /* Includes */ |
@@ -558,6 +558,7 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, | |||
558 | if (base_address == 0x00000000) { | 558 | if (base_address == 0x00000000) { |
559 | /* Something's wrong here, ACPIBASE has to be set */ | 559 | /* Something's wrong here, ACPIBASE has to be set */ |
560 | printk(KERN_ERR PFX "failed to get TCOBASE address\n"); | 560 | printk(KERN_ERR PFX "failed to get TCOBASE address\n"); |
561 | pci_dev_put(pdev); | ||
561 | return -ENODEV; | 562 | return -ENODEV; |
562 | } | 563 | } |
563 | iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version; | 564 | iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version; |
@@ -649,6 +650,7 @@ out: | |||
649 | if (iTCO_wdt_private.iTCO_version == 2) | 650 | if (iTCO_wdt_private.iTCO_version == 2) |
650 | iounmap(iTCO_wdt_private.gcs); | 651 | iounmap(iTCO_wdt_private.gcs); |
651 | iTCO_wdt_private.ACPIBASE = 0; | 652 | iTCO_wdt_private.ACPIBASE = 0; |
653 | pci_dev_put(iTCO_wdt_private.pdev); | ||
652 | return ret; | 654 | return ret; |
653 | } | 655 | } |
654 | 656 | ||
@@ -664,6 +666,7 @@ static void iTCO_wdt_cleanup(void) | |||
664 | release_region(TCOBASE, 0x20); | 666 | release_region(TCOBASE, 0x20); |
665 | if (iTCO_wdt_private.iTCO_version == 2) | 667 | if (iTCO_wdt_private.iTCO_version == 2) |
666 | iounmap(iTCO_wdt_private.gcs); | 668 | iounmap(iTCO_wdt_private.gcs); |
669 | pci_dev_put(iTCO_wdt_private.pdev); | ||
667 | } | 670 | } |
668 | 671 | ||
669 | static int iTCO_wdt_probe(struct platform_device *dev) | 672 | static int iTCO_wdt_probe(struct platform_device *dev) |