drm/vc4: Fix NULL pointer dereference in vc4_save_hang_state()
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 18 Jan 2018 14:58:21 +0000 (15:58 +0100)
committerEric Anholt <eric@anholt.net>
Thu, 18 Jan 2018 20:17:03 +0000 (12:17 -0800)
commit17b11b76b87afe9f8be199d7a5f442497133e2b0
treea664338716ad69536f4330670b8ffee74e6916e8
parentf61145f1a4bd7966aa0b15c5cd3950835b284f55
drm/vc4: Fix NULL pointer dereference in vc4_save_hang_state()

When saving BOs in the hang state we skip one entry of the
kernel_state->bo[] array, thus leaving it to NULL. This leads to a NULL
pointer dereference when, later in this function, we iterate over all
BOs to check their ->madv state.

Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20180118145821.22344-1-boris.brezillon@free-electrons.com
drivers/gpu/drm/vc4/vc4_gem.c