Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47d17763e987ebd5e9266fe3d9af3b22a64d27d8
Commit:     47d17763e987ebd5e9266fe3d9af3b22a64d27d8
Parent:     ff73231611127463ee94e72035f6a97f8435b39b
Author:     Hans-Christian Egtvedt <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 8 11:03:01 2007 -0700
Committer:  Wim Van Sebroeck <[EMAIL PROTECTED]>
CommitDate: Sun Jun 10 20:11:42 2007 +0000

    [WATCHDOG] at32ap700x-wdt: add iounmap if probe function fails
    
    Signed-off-by: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
    Cc: Haavard Skinnemoen <[EMAIL PROTECTED]>
    Signed-off-by: Wim Van Sebroeck <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
 drivers/char/watchdog/at32ap700x_wdt.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/char/watchdog/at32ap700x_wdt.c 
b/drivers/char/watchdog/at32ap700x_wdt.c
index a3e2887..745d38f 100644
--- a/drivers/char/watchdog/at32ap700x_wdt.c
+++ b/drivers/char/watchdog/at32ap700x_wdt.c
@@ -223,6 +223,11 @@ static int __init at32_wdt_probe(struct platform_device 
*pdev)
        }
 
        wdt->regs = ioremap(regs->start, regs->end - regs->start + 1);
+       if (!wdt->regs) {
+               ret = -ENOMEM;
+               dev_dbg(&pdev->dev, "could not map I/O memory\n");
+               goto err_free;
+       }
        wdt->users = 0;
        wdt->miscdev.minor = WATCHDOG_MINOR;
        wdt->miscdev.name = "watchdog";
@@ -238,7 +243,7 @@ static int __init at32_wdt_probe(struct platform_device 
*pdev)
        ret = misc_register(&wdt->miscdev);
        if (ret) {
                dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
-               goto err_register;
+               goto err_iounmap;
        }
 
        platform_set_drvdata(pdev, wdt);
@@ -247,7 +252,9 @@ static int __init at32_wdt_probe(struct platform_device 
*pdev)
 
        return 0;
 
-err_register:
+err_iounmap:
+       iounmap(wdt->regs);
+err_free:
        kfree(wdt);
        wdt = NULL;
        return ret;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to