diff options
| author | Xiaomeng Tong <xiam0nd.tong@gmail.com> | 2022-03-27 14:15:16 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 17:10:35 +0200 |
| commit | 761785e6071211d216fd33477df2aa0624e2202f (patch) | |
| tree | 013c05b209e90ac500f10847c8a31b25394c36f3 /include/uapi/linux | |
| parent | 15642852eae793ff8fe1d47a0c71fe6cda5f0e2d (diff) | |
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: ec9eab097a500 ("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>
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions
