summaryrefslogtreecommitdiff
path: root/drivers/watchdog/at91sam9_wdt.c
diff options
context:
space:
mode:
authorruanjinjie <ruanjinjie@huawei.com>2022-11-16 12:49:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 18:31:58 +0300
commit442c554b7f334c4e49ece2874cab50db42463a13 (patch)
treea6459f5e209b1ff5087a2c6bc3663beb1c424333 /drivers/watchdog/at91sam9_wdt.c
parent48f4132462056bf45b86894848be91c4996a7b72 (diff)
downloadlinux-442c554b7f334c4e49ece2874cab50db42463a13.tar.xz
watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
[ Upstream commit 07bec0e09c1afbab4c5674fd2341f4f52d594f30 ] free_irq() is missing in case of error in at91_wdt_init(), use devm_request_irq to fix that. Fixes: 5161b31dc39a ("watchdog: at91sam9_wdt: better watchdog support") Signed-off-by: ruanjinjie <ruanjinjie@huawei.com> Reviewed-by: Guenter 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: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/watchdog/at91sam9_wdt.c')
-rw-r--r--drivers/watchdog/at91sam9_wdt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index f4050a229eb5..aaa3c5a8c457 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -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;
}