Skip to content

Commit

Permalink
clk: Initialize max_rate in struct clk_rate_request
Browse files Browse the repository at this point in the history
Since commit b46fd8d ("clk: Zero the clk_rate_request structure"),
the clk_core_init_rate_req() function clears the struct clk_rate_request
passed as argument.

However, the default value for max_rate isn't 0 but ULONG_MAX, and we
end up creating a clk_rate_request instance where the maximum rate is 0.

Let's initialize max_rate to ULONG_MAX properly.

Fixes: b46fd8d ("clk: Zero the clk_rate_request structure")
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
mripard authored and bebarino committed Oct 28, 2022
1 parent 2079d02 commit 774560c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ static void clk_core_init_rate_req(struct clk_core * const core,
return;

memset(req, 0, sizeof(*req));
req->max_rate = ULONG_MAX;

if (!core)
return;
Expand Down

0 comments on commit 774560c

Please sign in to comment.