提交 4802c653 编写于 作者: W Wim Van Sebroeck

[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: NWim Van Sebroeck <wim@iguana.be>
上级 3836cc0f
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* Module and version information */ /* Module and version information */
#define DRV_NAME "iTCO_wdt" #define DRV_NAME "iTCO_wdt"
#define DRV_VERSION "1.00" #define DRV_VERSION "1.00"
#define DRV_RELDATE "18-Jun-2006" #define DRV_RELDATE "19-Jul-2006"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
/* Includes */ /* Includes */
...@@ -558,6 +558,7 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, ...@@ -558,6 +558,7 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent,
if (base_address == 0x00000000) { if (base_address == 0x00000000) {
/* Something's wrong here, ACPIBASE has to be set */ /* Something's wrong here, ACPIBASE has to be set */
printk(KERN_ERR PFX "failed to get TCOBASE address\n"); printk(KERN_ERR PFX "failed to get TCOBASE address\n");
pci_dev_put(pdev);
return -ENODEV; return -ENODEV;
} }
iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version; iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version;
...@@ -649,6 +650,7 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, ...@@ -649,6 +650,7 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent,
if (iTCO_wdt_private.iTCO_version == 2) if (iTCO_wdt_private.iTCO_version == 2)
iounmap(iTCO_wdt_private.gcs); iounmap(iTCO_wdt_private.gcs);
iTCO_wdt_private.ACPIBASE = 0; iTCO_wdt_private.ACPIBASE = 0;
pci_dev_put(iTCO_wdt_private.pdev);
return ret; return ret;
} }
...@@ -664,6 +666,7 @@ static void iTCO_wdt_cleanup(void) ...@@ -664,6 +666,7 @@ static void iTCO_wdt_cleanup(void)
release_region(TCOBASE, 0x20); release_region(TCOBASE, 0x20);
if (iTCO_wdt_private.iTCO_version == 2) if (iTCO_wdt_private.iTCO_version == 2)
iounmap(iTCO_wdt_private.gcs); iounmap(iTCO_wdt_private.gcs);
pci_dev_put(iTCO_wdt_private.pdev);
} }
static int iTCO_wdt_probe(struct platform_device *dev) static int iTCO_wdt_probe(struct platform_device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册