The patch titled at32ap700x-wdt: add iounmap if probe function fails has been added to the -mm tree. Its filename is watchdog-driver-for-at32ap700x-devices-fix-4.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: at32ap700x-wdt: add iounmap if probe function fails From: Hans-Christian Egtvedt <hcegtvedt@xxxxxxxxx> Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@xxxxxxxxx> Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx> Cc: Wim Van Sebroeck <wim@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/char/watchdog/at32ap700x_wdt.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff -puN drivers/char/watchdog/at32ap700x_wdt.c~watchdog-driver-for-at32ap700x-devices-fix-4 drivers/char/watchdog/at32ap700x_wdt.c --- a/drivers/char/watchdog/at32ap700x_wdt.c~watchdog-driver-for-at32ap700x-devices-fix-4 +++ a/drivers/char/watchdog/at32ap700x_wdt.c @@ -223,6 +223,11 @@ static int __init at32_wdt_probe(struct } 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 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 return 0; -err_register: +err_iounmap: + iounmap(wdt->regs); +err_free: kfree(wdt); wdt = NULL; return ret; _ Patches currently in -mm which might be from hcegtvedt@xxxxxxxxx are git-avr32.patch watchdog-driver-for-at32ap700x-devices.patch watchdog-driver-for-at32ap700x-devices-fix.patch watchdog-driver-for-at32ap700x-devices-fix-2.patch watchdog-driver-for-at32ap700x-devices-fix-3.patch watchdog-driver-for-at32ap700x-devices-fix-4.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html