[WATCHDOG] ar7_wdt: Fix error handling during probe.
authorWim Van Sebroeck <wim@iguana.be>
Mon, 31 Aug 2009 13:49:14 +0000 (13:49 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 18 Sep 2009 08:38:04 +0000 (08:38 +0000)
Fix error handling in the probe function.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Tested-by: Florian Fainelli <florian@openwrt.org>
drivers/watchdog/ar7_wdt.c

index 82855b0..2e94b71 100644 (file)
@@ -295,7 +295,7 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
        if (!ar7_wdt) {
                printk(KERN_ERR DRVNAME ": could not ioremap registers\n");
                rc = -ENXIO;
-               goto out;
+               goto out_mem_region;
        }
 
        ar7_wdt_disable_wdt();
@@ -311,6 +311,7 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev)
 
 out_alloc:
        iounmap(ar7_wdt);
+out_mem_region:
        release_mem_region(ar7_regs_wdt->start, resource_size(ar7_regs_wdt));
 out:
        return rc;