aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hcegtvedt@atmel.com>2007-06-08 14:03:01 -0400
committerWim Van Sebroeck <wim@iguana.be>2007-06-10 16:11:42 -0400
commit47d17763e987ebd5e9266fe3d9af3b22a64d27d8 (patch)
tree4623448be98c679e42000b1de8d8a800ce8668f1 /drivers/char
parentff73231611127463ee94e72035f6a97f8435b39b (diff)
[WATCHDOG] at32ap700x-wdt: add iounmap if probe function fails
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/watchdog/at32ap700x_wdt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/char/watchdog/at32ap700x_wdt.c b/drivers/char/watchdog/at32ap700x_wdt.c
index a3e288701baf..745d38f25190 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)
223 } 223 }
224 224
225 wdt->regs = ioremap(regs->start, regs->end - regs->start + 1); 225 wdt->regs = ioremap(regs->start, regs->end - regs->start + 1);
226 if (!wdt->regs) {
227 ret = -ENOMEM;
228 dev_dbg(&pdev->dev, "could not map I/O memory\n");
229 goto err_free;
230 }
226 wdt->users = 0; 231 wdt->users = 0;
227 wdt->miscdev.minor = WATCHDOG_MINOR; 232 wdt->miscdev.minor = WATCHDOG_MINOR;
228 wdt->miscdev.name = "watchdog"; 233 wdt->miscdev.name = "watchdog";
@@ -238,7 +243,7 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
238 ret = misc_register(&wdt->miscdev); 243 ret = misc_register(&wdt->miscdev);
239 if (ret) { 244 if (ret) {
240 dev_dbg(&pdev->dev, "failed to register wdt miscdev\n"); 245 dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
241 goto err_register; 246 goto err_iounmap;
242 } 247 }
243 248
244 platform_set_drvdata(pdev, wdt); 249 platform_set_drvdata(pdev, wdt);
@@ -247,7 +252,9 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
247 252
248 return 0; 253 return 0;
249 254
250err_register: 255err_iounmap:
256 iounmap(wdt->regs);
257err_free:
251 kfree(wdt); 258 kfree(wdt);
252 wdt = NULL; 259 wdt = NULL;
253 return ret; 260 return ret;