Re: [PATCH v4 1/2] clk: rs9: Add clock index range check to rs9_of_clk_get()

From: Marek Vasut

Date: Wed Mar 11 2026 - 11:39:05 EST


On 3/11/26 4:06 PM, Geert Uytterhoeven wrote:
rs9_of_clk_get() does not validate the clock index in the passed
DT clock specifier. If DT specifies an incorrect and out-of-range
index, this will access memory beyond the end of the clk_dif[] array.

Fix by this adding a range check to rs9_of_clk_get().

Fixes: 892e0ddea1aa6f70 ("clk: rs9: Add Renesas 9-series PCIe clock generator driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Reviewed-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxxxx>