mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
@ 2022-11-16  9:49 ruanjinjie
  2022-11-16 13:55 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: ruanjinjie @ 2022-11-16  9:49 UTC (permalink / raw)
  To: wim, linux, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	bbrezillon, linux-watchdog, linux-arm-kernel, linux-kernel
  Cc: ruanjinjie

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>
---
 drivers/watchdog/at91sam9_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 292b5a1ca831..b9e8572c707d 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -206,7 +206,7 @@ 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,
+		err = devm_request_irq(dev, wdt->irq, wdt_interrupt,
 				  IRQF_SHARED | IRQF_IRQPOLL |
 				  IRQF_NO_SUSPEND,
 				  pdev->name, wdt);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
  2022-11-16  9:49 [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path ruanjinjie
@ 2022-11-16 13:55 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-11-16 13:55 UTC (permalink / raw)
  To: ruanjinjie
  Cc: wim, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	bbrezillon, linux-watchdog, linux-arm-kernel, linux-kernel

On Wed, Nov 16, 2022 at 05:49:50PM +0800, ruanjinjie wrote:
> 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>


> ---
>  drivers/watchdog/at91sam9_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
> index 292b5a1ca831..b9e8572c707d 100644
> --- a/drivers/watchdog/at91sam9_wdt.c
> +++ b/drivers/watchdog/at91sam9_wdt.c
> @@ -206,7 +206,7 @@ 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,
> +		err = devm_request_irq(dev, wdt->irq, wdt_interrupt,
>  				  IRQF_SHARED | IRQF_IRQPOLL |
>  				  IRQF_NO_SUSPEND,
>  				  pdev->name, wdt);
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-16 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16  9:49 [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path ruanjinjie
2022-11-16 13:55 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®