linux-stable/drivers/gpu/drm/tilcdc
Xiaomeng Tong 8420201df3 tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator
commit 8b917cbe38 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:26:29 +02:00
..
Kconfig drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
Makefile doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line 2021-02-22 13:59:10 -07:00
tilcdc_crtc.c drm/tilcdc: fix pixel clock setting warning message 2021-03-24 12:05:28 +02:00
tilcdc_drv.c drm: Remove redundant 'flush_workqueue()' calls 2021-10-15 16:48:51 -07:00
tilcdc_drv.h drm/tilcdc: Convert to Linux IRQ interfaces 2021-08-10 20:13:53 +02:00
tilcdc_external.c tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator 2022-06-09 10:26:29 +02:00
tilcdc_external.h
tilcdc_panel.c drm/tilcdc: panel: fix platform_no_drv_owner.cocci warnings 2021-03-24 12:05:28 +02:00
tilcdc_panel.h
tilcdc_plane.c drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
tilcdc_regs.h