MLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table
authorJason Liu <jason.hui.liu@nxp.com>
Mon, 21 Aug 2017 21:00:02 +0000 (05:00 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:42 +0000 (15:36 -0500)
commitfc48f5bbf1be881dfef0622a5e6c74fa7af1da73
tree398fa47dcda4b593766260e96ba915e7447d5eb6
parent9cc79850918579396cfea0f82a1e2cd5b6c5b8a7
MLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table

Need to put the sentinel value to the end of the of_device_id array.
This patch also fixes the following KASAN complains when KASAN is enabled:

[    0.671315] ==================================================================
[    0.678400] BUG: KASAN: global-out-of-bounds in __of_match_node+0x70/0xb8 at addr ffff2000092958a8
[    0.687321] Read of size 1 by task swapper/0/1
[    0.691760] Address belongs to variable imx8qm_match+0xc8/0x260
[    0.697666] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03033-ge2e5fb2 #44
[    0.704955] Hardware name: Freescale i.MX8QM ARM2 (DT)
[    0.710081] Call trace:
[    0.712528] [<ffff20000808b438>] dump_backtrace+0x0/0x278
[    0.717907] [<ffff20000808b6c4>] show_stack+0x14/0x20
[    0.722949] [<ffff2000085311ec>] dump_stack+0xa4/0xc8
[    0.727990] [<ffff200008256cbc>] kasan_report_error+0x4c4/0x4d8
[    0.733892] [<ffff2000082570f8>] kasan_report+0x40/0x48
[    0.739103] [<ffff2000082552cc>] __asan_load1+0x4c/0x58
[    0.744318] [<ffff200008d7ac28>] __of_match_node+0x70/0xb8
[    0.749791] [<ffff200008d7aca8>] of_match_node+0x38/0x60
[    0.755088] [<ffff200008d7d870>] of_match_device+0x30/0x50
[    0.760565] [<ffff200008858dbc>] platform_match+0x6c/0x130
[    0.766040] [<ffff200008855dec>] __device_attach_driver+0x5c/0x138
[    0.772205] [<ffff200008852d18>] bus_for_each_drv+0xd0/0x130
[    0.777852] [<ffff2000088557fc>] __device_attach+0x13c/0x1a0
[    0.783499] [<ffff200008855f30>] device_initial_probe+0x10/0x18
[    0.789406] [<ffff200008854608>] bus_probe_device+0xe0/0xf0
[    0.794965] [<ffff200008851310>] device_add+0x5c8/0x818
[    0.800176] [<ffff200008d7dc3c>] of_device_add+0x5c/0x88
[    0.805477] [<ffff200008d7e854>] of_platform_device_create_pdata+0xb4/0x118
[    0.812426] [<ffff200008d7e8cc>] of_platform_device_create+0x14/0x20
[    0.818771] [<ffff200009913374>] arm_smmu_of_init+0x38/0x50
[    0.824332] [<ffff200009913298>] of_iommu_init+0xa4/0x100
[    0.829715] [<ffff200008083990>] do_one_initcall+0x90/0x1c8
[    0.835278] [<ffff2000098c1034>] kernel_init_freeable+0x290/0x330
[    0.841361] [<ffff20000905be28>] kernel_init+0x10/0x110
[    0.846567] [<ffff200008083680>] ret_from_fork+0x10/0x50
[    0.851860] Memory state around the buggy address:
[    0.856648]  ffff200009295780: fa fa fa fa 00 03 fa fa fa fa fa fa 00 00 00 00
[    0.863854]  ffff200009295800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    0.871065] >ffff200009295880: 00 00 00 00 00 fa fa fa fa fa fa fa 00 00 00 00
[    0.878270]                                   ^
[    0.882792]  ffff200009295900: 02 fa fa fa fa fa fa fa 00 00 07 fa fa fa fa fa
[    0.890003]  ffff200009295980: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
[    0.897208] ==================================================================

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
drivers/clk/imx/clk-imx8qm.c
drivers/clk/imx/clk-imx8qxp.c