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 |
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
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á
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 --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)
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(-)