]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
clk: sunxi-ng: Make sure divider tables have sentinel
authorJernej Skrabec <jernej.skrabec@siol.net>
Wed, 2 Dec 2020 20:38:17 +0000 (21:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:26:06 +0000 (11:26 +0100)
[ Upstream commit 48f68de00c1405351fa0e7bc44bca067c49cd0a3 ]

Two clock divider tables are missing sentinel at the end. Effect of that
is that clock framework reads past the last entry. Fix that with adding
sentinel at the end.

Issue was discovered with KASan.

Fixes: 0577e4853bfb ("clk: sunxi-ng: Add H3 clocks")
Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Link: https://lore.kernel.org/r/20201202203817.438713-1-jernej.skrabec@siol.net
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/sunxi-ng/ccu-sun50i-a64.c
drivers/clk/sunxi-ng/ccu-sun8i-h3.c

index 9ac6c299e0744304206c61ddea85d5dfef8f22f4..19304d6b2c05daf212c78a68a9b3e77cca8a44f2 100644 (file)
@@ -381,6 +381,7 @@ static struct clk_div_table ths_div_table[] = {
        { .val = 1, .div = 2 },
        { .val = 2, .div = 4 },
        { .val = 3, .div = 6 },
+       { /* Sentinel */ },
 };
 static const char * const ths_parents[] = { "osc24M" };
 static struct ccu_div ths_clk = {
index 61e3ba12773eac5b40d0bae5b19395d6d0fc1914..d9789378caf55ad562bb51255c88c1375a0d5dad 100644 (file)
@@ -328,6 +328,7 @@ static struct clk_div_table ths_div_table[] = {
        { .val = 1, .div = 2 },
        { .val = 2, .div = 4 },
        { .val = 3, .div = 6 },
+       { /* Sentinel */ },
 };
 static SUNXI_CCU_DIV_TABLE_WITH_GATE(ths_clk, "ths", "osc24M",
                                     0x074, 0, 2, ths_div_table, BIT(31), 0);