linux-stable/drivers/gpu/drm/stm
Xiaomeng Tong 2e6c86be0e stm: ltdc: fix two incorrect NULL checks on list iterator
The two bugs are here:
	if (encoder) {
	if (bridge && bridge->timings)

The list iterator value 'encoder/bridge' will *always* be set and
non-NULL by drm_for_each_encoder()/list_for_each_entry(), so it is
incorrect to assume that the iterator value will be NULL if the
list is empty or no element is found.

To fix the bug, use a new variable '*_iter' as the list iterator,
while use the old variable 'encoder/bridge' as a dedicated pointer
to point to the found element.

Cc: stable@vger.kernel.org
Fixes: 99e360442f ("drm/stm: Fix bus_flags handling")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Philippe Cornu <philippe.cornu@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220327055355.3808-1-xiam0nd.tong@gmail.com
2022-04-07 10:26:59 +02:00
..
drv.c drm/stm: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:47 +01:00
dw_mipi_dsi-stm.c drm/stm: dsi: provide the implementation of mode_valid() 2022-01-04 12:54:02 +01:00
Kconfig drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
ltdc.c stm: ltdc: fix two incorrect NULL checks on list iterator 2022-04-07 10:26:59 +02:00
ltdc.h drm/stm: ltdc: add support for CRC hashing feature 2022-02-25 14:14:28 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00