android_kernel_xiaomi_sm7250/drivers/gpu/drm/tilcdc
Xiaomeng Tong 761785e607 tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator
[ Upstream commit 8b917cbe38e9b0d002492477a9fc2bfee2412ce4 ]

The bug is here:
	if (!encoder) {

The list iterator value 'encoder' will *always* be set and non-NULL
by 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 original variable 'encoder' as a dedicated pointer
to point to the found element.

Cc: stable@vger.kernel.org
Fixes: ec9eab097a ("drm/tilcdc: Add drm bridge support for attaching drm bridge drivers")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi>
Tested-by: Jyri Sarha <jyri.sarha@iki.fi>
Signed-off-by: Jyri Sarha <jyri.sarha@iki.fi>
Link: https://patchwork.freedesktop.org/patch/msgid/20220327061516.5076-1-xiam0nd.tong@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-07-29 17:10:35 +02:00
..
Kconfig
Makefile
tilcdc_crtc.c
tilcdc_drv.c
tilcdc_drv.h
tilcdc_external.c
tilcdc_external.h
tilcdc_panel.c
tilcdc_panel.h
tilcdc_plane.c
tilcdc_regs.h
tilcdc_tfp410.c
tilcdc_tfp410.h