From: Roger He Date: Fri, 17 Nov 2017 04:45:18 +0000 (+0800) Subject: drm/amd/amdgpu: fix over-bound accessing in amdgpu_cs_wait_any_fence X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=eb174c77e258f93b0f1046afd23a0aede68be3f2;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Chunming Zhou Signed-off-by: Roger He Signed-off-by: Alex Deucher --- 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;