mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
clk: imx: off by one in imx_lpcg_parse_clks_from_dt()
[ Upstream commit135efc3a76] The > needs to be >= to prevent an off by one access. Fixes:d5f1e6a2bb("clk: imx: imx8qxp-lpcg: add parsing clocks from device tree") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Abel Vesa <abel.vesa@nxp.com> Link: https://lore.kernel.org/r/20220228075014.GD13685@kili Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4bd979ee99
commit
4b8a71f206
|
|
@ -248,7 +248,7 @@ static int imx_lpcg_parse_clks_from_dt(struct platform_device *pdev,
|
|||
|
||||
for (i = 0; i < count; i++) {
|
||||
idx = bit_offset[i] / 4;
|
||||
if (idx > IMX_LPCG_MAX_CLKS) {
|
||||
if (idx >= IMX_LPCG_MAX_CLKS) {
|
||||
dev_warn(&pdev->dev, "invalid bit offset of clock %d\n",
|
||||
i);
|
||||
ret = -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user