clk: stm32: Fix out-by-one error path in the index lookup
If stm32f4_rcc_lookup() is called with primary == 0 and secondary == 192 then it will read beyond the end of the table array due to an out-by-one error in the range check. In addition to the fixing the inequality we also modify the r.h.s. to make it even more explicit that we are comparing against the size of table in bits. Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org> Acked-by: NMaxime Coquelin <mcoquelin.stm32@gmail.com> Fixes: 358bdf89 ("clk: stm32: Add clock driver for STM32F4[23]xxx devices") Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
Showing
想要评论请 注册 或 登录