aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-11-17 12:45:18 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-11-17 15:00:52 -0500
commiteb174c77e258f93b0f1046afd23a0aede68be3f2 (patch)
tree5b37f43a6b654585861c61402630acbf5888ce73 /drivers/gpu
parentdrm/amd/powerplay: fix unfreeze level smc message for smu7 (diff)
downloadlinux-dev-eb174c77e258f93b0f1046afd23a0aede68be3f2.tar.xz
linux-dev-eb174c77e258f93b0f1046afd23a0aede68be3f2.zip
drm/amd/amdgpu: fix over-bound accessing in amdgpu_cs_wait_any_fence
Fixes an oops in amdgpu_cs_wait_any_fence. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 146e05f21d35..bdef497a6a26 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1498,7 +1498,7 @@ out:
wait->out.status = (r > 0);
wait->out.first_signaled = first;
- if (array[first])
+ if (first < fence_count && array[first])
r = array[first]->error;
else
r = 0;