diff mbox series

[RESEND,(again),2/2] clk: use clk_core_unlink_consumer() helper

Message ID 20240710-dev-clk-misc-v1-2-cd9d960099a2@analog.com (mailing list archive)
State Accepted, archived
Headers show
Series clk: fix possible use after free | expand

Commit Message

Nuno Sa July 10, 2024, 8:40 a.m. UTC
There is an helper to remove a consumer from the clk provider list.
Hence, let's use it when releasing a consumer.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Aug. 6, 2024, 9:50 p.m. UTC | #1
Quoting Nuno Sá (2024-07-10 01:40:36)
> There is an helper to remove a consumer from the clk provider list.
> Hence, let's use it when releasing a consumer.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---

Applied to clk-next
Nuno Sá Aug. 12, 2024, 5:22 a.m. UTC | #2
On Tue, 2024-08-06 at 14:50 -0700, Stephen Boyd wrote:
> Quoting Nuno Sá (2024-07-10 01:40:36)
> > There is an helper to remove a consumer from the clk provider list.
> > Hence, let's use it when releasing a consumer.
> > 
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > ---
> 
> Applied to clk-next

Hi Stephen,

I realized only this one was applied and not the first patch. Could you please tell
me why it's not being accepted or if I should do it somehow differently? Or it just
needs better look at?

- Nuno Sá
Stephen Boyd Aug. 12, 2024, 5:57 p.m. UTC | #3
Quoting Nuno Sá (2024-08-11 22:22:54)
> On Tue, 2024-08-06 at 14:50 -0700, Stephen Boyd wrote:
> > Quoting Nuno Sá (2024-07-10 01:40:36)
> > > There is an helper to remove a consumer from the clk provider list.
> > > Hence, let's use it when releasing a consumer.
> > > 
> > > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > > ---
> > 
> > Applied to clk-next
> 
> Hi Stephen,
> 
> I realized only this one was applied and not the first patch. Could you please tell
> me why it's not being accepted or if I should do it somehow differently? Or it just
> needs better look at?
> 

I will re-send the first patch in a day or so. I wrote a pile of KUnit
tests for it.
diff mbox series

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b11beeca7e55..ed0731a4b773 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -4764,7 +4764,7 @@  void __clk_put(struct clk *clk)
 		clk->exclusive_count = 0;
 	}
 
-	hlist_del(&clk->clks_node);
+	clk_core_unlink_consumer(clk);
 
 	/* If we had any boundaries on that clock, let's drop them. */
 	if (clk->min_rate > 0 || clk->max_rate < ULONG_MAX)