]> git.baikalelectronics.ru Git - kernel.git/commit
soc: imx: imx8m-blk-ctrl: off by one in imx8m_blk_ctrl_xlate()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 11 Oct 2021 12:36:38 +0000 (15:36 +0300)
committerShawn Guo <shawnguo@kernel.org>
Fri, 15 Oct 2021 03:10:05 +0000 (11:10 +0800)
commit302c012738e0831c2a9e522e16f40b75a7bba9e9
treeaa72019cee40c742722728fc88bb86b62c13879c
parentf2f9d76079e51e0b377973d3e1d73d4619dc841d
soc: imx: imx8m-blk-ctrl: off by one in imx8m_blk_ctrl_xlate()

The > comparison should be >= to prevent reading one element beyond the
end of the array.  The onecell_data->domains[] array is allocated in
imx8m_blk_ctrl_probe() and it has "onecell_data->num_domains" elements.

Fixes: 5b340e7813d4 ("soc: imx: add i.MX8M blk-ctrl driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/imx8m-blk-ctrl.c