diff mbox series

clk: imx: clk-imx7ulp: Add missing sentinel of ulp_div_table

Message ID 1574402986-11117-1-git-send-email-peng.fan@nxp.com (mailing list archive)
State Superseded, archived
Headers show
Series clk: imx: clk-imx7ulp: Add missing sentinel of ulp_div_table | expand

Commit Message

Peng Fan Nov. 22, 2019, 6:11 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

There should be a sentinel of ulp_div_table, otherwise _get_table_div
may access data out of the array.

Fixes: b1260067ac3d ("clk: imx: add imx7ulp clk driver")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/imx/clk-imx7ulp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Shawn Guo Dec. 9, 2019, 2:54 a.m. UTC | #1
On Fri, Nov 22, 2019 at 06:11:42AM +0000, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> There should be a sentinel of ulp_div_table, otherwise _get_table_div
> may access data out of the array.
> 
> Fixes: b1260067ac3d ("clk: imx: add imx7ulp clk driver")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c
index 3fdf3d494f0a..281191b55b3a 100644
--- a/drivers/clk/imx/clk-imx7ulp.c
+++ b/drivers/clk/imx/clk-imx7ulp.c
@@ -40,6 +40,7 @@  static const struct clk_div_table ulp_div_table[] = {
 	{ .val = 5, .div = 16, },
 	{ .val = 6, .div = 32, },
 	{ .val = 7, .div = 64, },
+	{ /* sentinel */ },
 };
 
 static const int pcc2_uart_clk_ids[] __initconst = {