Commit eb174c77 authored by Roger He's avatar Roger He Committed by Alex Deucher

drm/amd/amdgpu: fix over-bound accessing in amdgpu_cs_wait_any_fence

Fixes an oops in amdgpu_cs_wait_any_fence.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Signed-off-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fd78e6af
...@@ -1498,7 +1498,7 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, ...@@ -1498,7 +1498,7 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,
wait->out.status = (r > 0); wait->out.status = (r > 0);
wait->out.first_signaled = first; wait->out.first_signaled = first;
if (array[first]) if (first < fence_count && array[first])
r = array[first]->error; r = array[first]->error;
else else
r = 0; r = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment