Skip to content
Commit 03bc10ab authored by Boris Brezillon's avatar Boris Brezillon Committed by Michael Turquette
Browse files

clk: check ->determine/round_rate() return value in clk_calc_new_rates



->determine_rate() and ->round_rate() can return the closest rate to the
requested one or an error code.
clk_calc_new_rates is assuming these functions can't return a negative
value, which leads to a undefined behavior when the clk implementation
returns such an error code.
Fix this by returning NULL in case ->determine_rate() or ->round_rate()
returned an error code.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent 45912431
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment