[PATCH 20/22] clk: Zero the clk_rate_request structure

Maxime Ripard
2022-04-08T09:14:41Z

In order to make sure we don't carry anything over from an already
existing clk_rate_request pointer we would pass to
clk_core_init_rate_req(), let's zero the entire structure before
initializing it.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/clk/clk.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 53f5f7434be0..3fbd55119215 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1440,6 +1440,8 @@ static void clk_core_init_rate_req(struct clk_core * const core,
if (WARN_ON(!core || !req))
return;

+ memset(req, 0, sizeof(*req));
+
req->rate = rate;
clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);

--
2.35.1