]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gma500: Fix end of loop tests for list_for_each_entry
authorHarshvardhan Jha <harshvardhan.jha@oracle.com>
Fri, 9 Jul 2021 07:39:59 +0000 (13:09 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 9 Jul 2021 08:06:11 +0000 (10:06 +0200)
commit05649680edba6682d8b69a4dc982494637994acc
treed18cbb71b87da26fdea6b6702b0e4b3eb590fcb1
parent4fb05fa32a4eaa4aa5e377bc9755f8ec0614ff95
drm/gma500: Fix end of loop tests for list_for_each_entry

The list_for_each_entry() iterator, "connector" in this code, can never be
NULL.  If we exit the loop without finding the correct  connector then
"connector" points invalid memory that is an offset from the list head.
This will eventually lead to memory corruption and presumably a kernel
crash.

Fixes: 85276d9b7b1e ("gma500: Convert Oaktrail to work with new output handling")
Signed-off-by: Harshvardhan Jha <harshvardhan.jha@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210709073959.11443-1-harshvardhan.jha@oracle.com
drivers/gpu/drm/gma500/oaktrail_lvds.c