Commit 07bec0e0 authored by ruanjinjie's avatar ruanjinjie Committed by Wim Van Sebroeck

watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path

free_irq() is missing in case of error in at91_wdt_init(), use
devm_request_irq to fix that.

Fixes: 5161b31d ("watchdog: at91sam9_wdt: better watchdog support")
Signed-off-by: default avatarruanjinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20221116094950.3141943-1-ruanjinjie@huawei.com
[groeck: Adjust multi-line alignment]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent f769f979
......@@ -206,10 +206,9 @@ static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt)
"min heartbeat and max heartbeat might be too close for the system to handle it correctly\n");
if ((tmp & AT91_WDT_WDFIEN) && wdt->irq) {
err = request_irq(wdt->irq, wdt_interrupt,
IRQF_SHARED | IRQF_IRQPOLL |
IRQF_NO_SUSPEND,
pdev->name, wdt);
err = devm_request_irq(dev, wdt->irq, wdt_interrupt,
IRQF_SHARED | IRQF_IRQPOLL | IRQF_NO_SUSPEND,
pdev->name, wdt);
if (err)
return err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment