Re: [PATCH v1] clk: devres: fix cleanup in devm_clk_get_optional_enabled_with_rate()

Stephen Boyd <[email protected]>
Newsgroups org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel
Message-ID <178668601557.5897.11262008307765555513@lazor>
Quoting Onur Özkan (2026-08-01 04:16:34)
> devm_clk_get_optional_enabled_with_rate() registers its cleanup action
> before setting the clock rate. If setting the rate fails, it attempts to
> disable and unprepare a clock that was never enabled. This issue was
> spotted while reviewing "rust: clk: add devres-managed clks" [1].
> 
> Register the cleanup action only after successfully preparing and enabling
> the clock.
> 
> [1]: https://lore.kernel.org/rust-for-linux/[email protected]
> 
> Fixes: 9934a1bd45b2 ("clk: provide devm_clk_get_optional_enabled_with_rate()")
> Signed-off-by: Onur Özkan <[email protected]>
> ---

Applied to clk-next
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.