aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-10-06 16:41:12 -0400
committerWim Van Sebroeck <wim@iguana.be>2006-10-07 16:43:56 -0400
commite34477e9906acc137329b654a51fb7d4598813f7 (patch)
treec7882b29cd63d924d472e2d2d244e68c70f7edd5 /drivers/char
parentff02cfc76a5040ee125c597baa1cfc9874918ed2 (diff)
[WATCHDOG] ioremap balanced with iounmap for drivers/char/watchdog/s3c2410_wdt.c
ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad <amol@verismonetworks.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index b36a04ae9ab8..d54d0efe0756 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -381,18 +381,21 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
381 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 381 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
382 if (res == NULL) { 382 if (res == NULL) {
383 printk(KERN_INFO PFX "failed to get irq resource\n"); 383 printk(KERN_INFO PFX "failed to get irq resource\n");
384 iounmap(wdt_base);
384 return -ENOENT; 385 return -ENOENT;
385 } 386 }
386 387
387 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev); 388 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev);
388 if (ret != 0) { 389 if (ret != 0) {
389 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); 390 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
391 iounmap(wdt_base);
390 return ret; 392 return ret;
391 } 393 }
392 394
393 wdt_clock = clk_get(&pdev->dev, "watchdog"); 395 wdt_clock = clk_get(&pdev->dev, "watchdog");
394 if (wdt_clock == NULL) { 396 if (wdt_clock == NULL) {
395 printk(KERN_INFO PFX "failed to find watchdog clock source\n"); 397 printk(KERN_INFO PFX "failed to find watchdog clock source\n");
398 iounmap(wdt_base);
396 return -ENOENT; 399 return -ENOENT;
397 } 400 }
398 401
@@ -416,6 +419,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
416 if (ret) { 419 if (ret) {
417 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", 420 printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
418 WATCHDOG_MINOR, ret); 421 WATCHDOG_MINOR, ret);
422 iounmap(wdt_base);
419 return ret; 423 return ret;
420 } 424 }
421 425
@@ -452,6 +456,7 @@ static int s3c2410wdt_remove(struct platform_device *dev)
452 wdt_clock = NULL; 456 wdt_clock = NULL;
453 } 457 }
454 458
459 iounmap(wdt_base);
455 misc_deregister(&s3c2410wdt_miscdev); 460 misc_deregister(&s3c2410wdt_miscdev);
456 return 0; 461 return 0;
457} 462}