Skip to content

Commit

Permalink
clk: stm32: Fix a signedness issue in clk_stm32_composite_determine_r…
Browse files Browse the repository at this point in the history
…ate()

commit 790437b upstream.

The divider_ro_round_rate() function could potentially return -EINVAL on
error but the error handling doesn't work because "rate" is unsigned.
It should be a type long.

Fixes: 06ed0fc ("clk: stm32: composite: Switch to determine_rate")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/d9a78453-9b40-48c1-830e-00751ba3ecb8@kili.mountain
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Nov 2, 2023
1 parent 302479e commit adebf49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/stm32/clk-stm32-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int clk_stm32_composite_determine_rate(struct clk_hw *hw,
{
struct clk_stm32_composite *composite = to_clk_stm32_composite(hw);
const struct stm32_div_cfg *divider;
unsigned long rate;
long rate;

if (composite->div_id == NO_STM32_DIV)
return 0;
Expand Down

0 comments on commit adebf49

Please sign in to comment.