winsys/amdgpu: avoid potential segfault in amdgpu_bo_map()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 2 Feb 2017 17:40:18 +0000 (18:40 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 3 Feb 2017 11:07:14 +0000 (12:07 +0100)
commitaf303abcdbeac3b90fb760de19bed56cc40cfff4
treedb67302a9c3c0db6aaa4216569258deebb01297b
parent0a2dcd3a8ac4bf18cd6ec2f778c9ef859ef90a51
winsys/amdgpu: avoid potential segfault in amdgpu_bo_map()

cs can be NULL when it comes from r600_buffer_map_sync_with_rings()
to avoid doing the same checks. It was checked for write mappings
but not for read mappings.

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c