mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: ruanjinjie <ruanjinjie@huawei.com>
Cc: wim@linux-watchdog.org, nicolas.ferre@microchip.com,
	alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com,
	bbrezillon@kernel.org, linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
Date: Wed, 16 Nov 2022 05:55:00 -0800	[thread overview]
Message-ID: <20221116135500.GC3498904@roeck-us.net> (raw)
In-Reply-To: <20221116094950.3141943-1-ruanjinjie@huawei.com>

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
> 

      reply	other threads:[~2022-11-16 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  9:49 ruanjinjie
2022-11-16 13:55 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221116135500.GC3498904@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=claudiu.beznea@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=ruanjinjie@huawei.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®