linux/drivers/gpu/drm/imx
Arnd Bergmann 33ce7f2f95 drm/imx: imx-ldb: fix out of bounds array access warning
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>
2021-03-25 07:48:34 +01:00
..
dcss drm/imx/dcss: allow using nearest neighbor interpolation scaling 2020-11-26 11:29:44 +01:00
dw_hdmi-imx.c drm/imx: dw_hdmi-imx: use drm managed resources 2021-01-04 12:59:33 +01:00
imx-drm-core.c drm/imx: fix memory leak when fails to init 2021-03-25 07:43:42 +01: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-03-25 07:48:34 +01:00
imx-tve.c drm/imx: imx-tve: use drm managed resources 2021-01-04 12:59:33 +01:00
ipuv3-crtc.c drm/imx: ipuv3-crtc: use drm managed resources 2021-01-04 12:59:34 +01:00
ipuv3-plane.c drm/imx: ipuv3-plane: use drm managed resources 2021-01-04 12:59:34 +01:00
ipuv3-plane.h drm/imx: ipuv3-plane: use drm managed resources 2021-01-04 12:59:34 +01:00
Kconfig drm/imx: dw_hdmi-imx: depend on OF to fix randconfig compile tests on x86_64 2021-01-07 11:54:21 +01: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: use drm managed resources 2021-01-04 12:59:34 +01:00