aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger He <[email protected]>2017-11-17 12:45:18 +0800
committerAlex Deucher <[email protected]>2017-11-17 15:00:52 -0500
commiteb174c77e258f93b0f1046afd23a0aede68be3f2 (patch)
tree5b37f43a6b654585861c61402630acbf5888ce73
parentfd78e6af810377363a2b3439b942840fa4f4ea86 (diff)
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 <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Signed-off-by: Roger He <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-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;