linux/drivers/gpu/drm/imx
Arnd Bergmann 870c8df1d1 drm/imx: imx-ldb: fix out of bounds array access warning
[ Upstream commit 33ce7f2f95 ]

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-04-16 11:43:20 +02:00
..
dcss drm/imx/dcss: fix rotations for Vivante tiled formats 2020-12-30 11:53:22 +01:00
dw_hdmi-imx.c drm/imx: dw_hdmi-imx: remove empty encoder_disable callback 2020-10-26 10:59:16 +01:00
imx-drm-core.c drm/imx: fix memory leak when fails to init 2021-04-07 15:00:11 +02:00
imx-drm.h drm/imx: Use simple encoder 2020-04-02 14:16:44 +02:00
imx-ldb.c drm/imx: imx-ldb: fix out of bounds array access warning 2021-04-16 11:43:20 +02:00
imx-tve.c drm/imx: tve remove extraneous type qualifier 2020-10-27 10:30:09 +01:00
ipuv3-crtc.c drm/imx: error path fixes and cleanups 2020-07-23 15:21:45 +10:00
ipuv3-plane.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ipuv3-plane.h drm/imx: ipuv3-plane: fix atomic update status query for non-plus i.MX6Q 2019-05-27 15:13:57 +02:00
Kconfig drm/imx: Add initial support for DCSS on iMX8MQ 2020-09-09 16:39:48 +02:00
Makefile drm/imx: Add initial support for DCSS on iMX8MQ 2020-09-09 16:39:48 +02:00
parallel-display.c drm/imx: parallel-display: reduce scope of edid_len 2020-10-27 10:20:36 +01:00