Skip to content

Commit 8358a76

Browse files
committed
clk: Remove prepare_lock hold assertion in __clk_release()
Removing this assertion lets us move the kref_put() call outside the prepare_lock section. We don't need to hold the prepare_lock here to free memory and destroy the clk_core structure. We've already unlinked the clk from the clk tree and by the time the release function runs nothing holds a reference to the clk_core anymore so anything with the pointer can't access the memory that's being freed anyway. Way back in commit 496eadf ("clk: Use lockdep asserts to find missing hold of prepare_lock") we didn't need to have this assertion either. Fixes: 496eadf ("clk: Use lockdep asserts to find missing hold of prepare_lock") Cc: Krzysztof Kozlowski <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4cece76 commit 8358a76

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/clk/clk.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4375,8 +4375,6 @@ static void __clk_release(struct kref *ref)
43754375
{
43764376
struct clk_core *core = container_of(ref, struct clk_core, ref);
43774377

4378-
lockdep_assert_held(&prepare_lock);
4379-
43804378
clk_core_free_parent_map(core);
43814379
kfree_const(core->name);
43824380
kfree(core);

0 commit comments

Comments
 (0)