TencentOS-kernel/drivers/gpu/drm/imx
Arnd Bergmann 2e79bd1da0 drm/imx: imx-ldb: fix out of bounds array access warning
[ Upstream commit 33ce7f2f95cabb5834cf0906308a5cb6103976da ]

When CONFIG_OF is disabled, building with 'make W=1' produces warnings
about out of bounds array access:

drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_set_clock.constprop':
drivers/gpu/drm/imx/imx-ldb.c:186:8: error: array subscript -22 is below array bounds of 'struct clk *[4]' [-Werror=array-bounds]

Add an error check before the index is used, which helps with the
warning, as well as any possible other error condition that may be
triggered at runtime.

The warning could be fixed by adding a Kconfig depedency on CONFIG_OF,
but Liu Ying points out that the driver may hit the out-of-bounds
problem at runtime anyway.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:05 +08:00
..
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dw_hdmi-imx.c drm/imx: fix use after free 2021-03-16 16:33:36 +08:00
imx-drm-core.c drm/imx: fix use after free 2021-03-16 16:33:36 +08:00
imx-drm.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
imx-ldb.c drm/imx: imx-ldb: fix out of bounds array access warning 2021-05-20 16:07:05 +08:00
imx-tve.c drm/imx: tve: fix regulator_disable error path 2021-03-16 16:33:37 +08:00
ipuv3-crtc.c drm/imx: fix use after free 2021-03-16 16:33:36 +08:00
ipuv3-plane.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipuv3-plane.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parallel-display.c drm/imx: fix use after free 2021-03-16 16:33:36 +08:00