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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:44 +0000 (14:03 +0100)
commit9ad970c8a13595e38d3af98114bcbbec6d8a5be4
tree3e5798c7634a1e1471dcd998e975830ab83d7427
parentdd55bfca560733d37f53a04cf628c5d6a7d5d0da
drm/vc4: Fix NULL pointer dereference in vc4_save_hang_state()

commit 17b11b76b87afe9f8be199d7a5f442497133e2b0 upstream.

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")
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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vc4/vc4_gem.c