diff options
author | Xiaomeng Tong <xiam0nd.tong@gmail.com> | 2022-03-27 13:53:55 +0800 |
---|---|---|
committer | Philippe Cornu <philippe.cornu@foss.st.com> | 2022-04-07 10:26:59 +0200 |
commit | 2e6c86be0e57079d1fb6c7c7e5423db096d0548a (patch) | |
tree | 2f1e33cc53b862be579e1952d918bdeebbc8be26 /drivers/dax/dax-private.h | |
parent | c8d4c18bfbc4ab467188dbe45cc8155759f49d9e (diff) |
stm: ltdc: fix two incorrect NULL checks on list iterator
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
Diffstat (limited to 'drivers/dax/dax-private.h')
0 files changed, 0 insertions, 0 deletions