Files
android_kernel_xiaomi_sm8450/drivers/gpu/drm
Xiaomeng Tong 4e2fbe8cda stm: ltdc: fix two incorrect NULL checks on list iterator
commit 2e6c86be0e57079d1fb6c7c7e5423db096d0548a upstream.

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: 99e360442f223 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:21:27 +02:00
..
2020-08-11 11:58:31 +10:00
2022-06-09 10:21:00 +02:00
2020-04-03 17:11:41 +02:00
2020-09-08 14:41:40 +10:00
2021-11-26 10:39:20 +01:00
2020-09-11 10:47:19 +02:00
2021-05-11 14:47:26 +02:00
2020-05-27 14:31:42 +03:00
2020-04-03 17:11:41 +02:00
2020-09-21 10:45:08 +02:00
2020-05-29 12:58:11 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2021-03-30 14:31:51 +02:00