drm/vc4: Fix NULL pointer dereference in the async update path
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 15 Nov 2018 10:58:51 +0000 (11:58 +0100)
committerpopcornmix <popcornmix@gmail.com>
Fri, 9 Aug 2019 16:57:40 +0000 (18:57 +0200)
commitf1c1b67b26ed3cb789037d1c844d4105deaa3cfd
tree6abc5579addfa541de1e395cb93a66a1964569d1
parentc3f1afdbcfef63fa720f6143f1ee417d8d87d4e7
drm/vc4: Fix NULL pointer dereference in the async update path

vc4_plane_atomic_async_update() calls vc4_plane_atomic_check()
which in turn calls vc4_plane_setup_clipping_and_scaling(), and since
commit 58a6a36fe8e0 ("drm/vc4: Use
drm_atomic_helper_check_plane_state() to simplify the logic"), this
function accesses plane_state->state which will be NULL when called
from the async update path because we're passing the current plane
state, and plane_state->state has been assigned to NULL in
drm_atomic_helper_swap_state().

Pass the new state instead of the current one (the new state has
->state set to a non-NULL value).

Fixes: 58a6a36fe8e0 ("drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181115105852.9844-1-boris.brezillon@bootlin.com
drivers/gpu/drm/vc4/vc4_plane.c