Re: [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup

[email protected]
Newsgroups org.kernel.vger.linux-watchdog
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Returning -EPROBE_DEFER directly leaks the clock reference and enable count by bypassing the cleanup path.
--

--- Patch [1]: [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup ---
commit 0ad8e477efab703bb8fdf2177c651643b3096974
Author: bui duc phuc <[email protected]>

watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup

This commit propagates -EPROBE_DEFER from platform_get_irq_optional() so
the driver is re-probed when the interrupt resource becomes available
instead of continuing without an IRQ.

> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 1802634cc7cda..c132533b997d0 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -606,6 +606,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
>  
>  	/* Request the IRQ only after the watchdog is disabled */
>  	irq = platform_get_irq_optional(pdev, 0);
> +	if (irq == -EPROBE_DEFER)
> +		return irq;

[Severity: High]
Does this direct return leak the clock reference and enable count?

Since dev->data->clock_init() was called earlier in orion_wdt_probe(),
would setting ret = irq and jumping to the disable_clk label ensure that
clk_disable_unprepare() and clk_put() are correctly called on probe deferral?

>  	if (irq > 0) {
>  		/*
>  		 * Not all supported platforms specify an interrupt for the

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.