Re: [PATCH v2 1/2] watchdog: orion_wdt: Propagate errors from optional IRQ lookup

Bui Duc Phuc <[email protected]>
Newsgroups org.kernel.vger.linux-watchdog,dev.linux.lists.sashiko-reviews
Message-ID <CAABR9nH9w=q4cqokrGOE53ZaZhx4=AFyXrup4CdgF9LZyV=QaQ@mail.gmail.com>
> [Severity: High]
> Does this early return bypass the clock cleanup?
>
> Earlier in orion_wdt_probe(), the hardware clock is initialized and enabled by
> dev->data->clock_init(pdev, dev). The other error paths in this function jump
> to the disable_clk label to clean it up.
>
> If we return directly here when an error like -EPROBE_DEFER occurs, it appears
> we might leak the hardware clock reference and its enablement state because we
> bypass clk_disable_unprepare() and clk_put() in the disable_clk error path.
> This could lead to repeated resource leaks if probe deferral happens multiple
> times.
>
> Should this use goto disable_clk instead of returning directly?
>

I agree that this makes sense. I'll make the change and send v3.
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.