Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a62591e3 authored by Xiaomeng Tong's avatar Xiaomeng Tong Committed by Greg Kroah-Hartman
Browse files

tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator



commit 8b917cbe38e9b0d002492477a9fc2bfee2412ce4 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: ec9eab09 ("drm/tilcdc: Add drm bridge support for attaching drm bridge drivers")
Signed-off-by: default avatarXiaomeng Tong <xiam0nd.tong@gmail.com>
Reviewed-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
Tested-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
Signed-off-by: default avatarJyri Sarha <jyri.sarha@iki.fi>
Link: https://patchwork.freedesktop.org/patch/msgid/20220327061516.5076-1-xiam0nd.tong@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77ec584d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment