diff options
| author | Onur Özkan <work@onurozkan.dev> | 2026-08-01 14:16:34 +0300 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2026-08-17 09:28:16 -0700 |
| commit | 0d4d262c1664365e17e0a5ba2ab79f4db484b44e (patch) | |
| tree | 1d67fef8669040a22585b4f81938988eb1fd9648 /include/linux/debugobjects.h | |
| parent | 368500fcb3679af69b244e394a35be47a799a725 (diff) | |
clk: devres: fix cleanup in devm_clk_get_optional_enabled_with_rate()
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/20260706-clk-type-state-v5-3-67c5f326a16c@collabora.com
Fixes: 9934a1bd45b2 ("clk: provide devm_clk_get_optional_enabled_with_rate()")
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
