drm/amdgpu: don't leave dangling pointers around
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 25 Sep 2016 20:34:46 +0000 (23:34 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Sep 2016 17:00:51 +0000 (13:00 -0400)
commit54ddf3a6af537cbfe038f9a2754f26de80c5818b
tree69c4821436f125ff09faff6f71873c913c3d33ba
parentd8907643cc6b00e96aeb1555f0e0c2930f69c18b
drm/amdgpu: don't leave dangling pointers around

Right now it's possible to trigger fence_drv.fences[] dereference after
the array has been freed. While the real problem is elsewhere, this still
results in confusing errors that depend on how the freed memory was
reused (I've seen "kernel tried to execute NX-protected page"), it's
better to clear them and get NULL dereference so that it's obvious what's
going wrong.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c