[PATCH][V2] clk: uniphier: Fix potential infinite loop
Stephen Boyd
sboyd at kernel.org
Tue Apr 13 03:10:29 BST 2021
Quoting Colin King (2021-04-09 02:01:04)
> From: Colin Ian King <colin.king at canonical.com>
>
> The for-loop iterates with a u8 loop counter i and compares this
> with the loop upper limit of num_parents that is an int type.
> There is a potential infinite loop if num_parents is larger than
> the u8 loop counter. Fix this by making the loop counter the same
> type as num_parents. Also make num_parents an unsigned int to
> match the return type of the call to clk_hw_get_num_parents.
>
> Addresses-Coverity: ("Infinite loop")
> Fixes: 734d82f4a678 ("clk: uniphier: add core support code for UniPhier clock driver")
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
Applied to clk-next
More information about the linux-arm-kernel
mailing list