drm/amdgpu: Fix null pointer issue in amdgpu_cs_wait_any_fence
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix null pointer issue in amdgpu_cs_wait_any_fence
The array[first] may be null when the fence has already been signaled.
BUG: SWDEV-136239
Signed-off-by Emily Deng <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -2
@@ -1502,8 +1502,11 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,memset (wait,0 ,sizeof (*wait)); wait->out.status = (r >0 ); wait->out.first_signaled = first; -/* set return value 0 to indicate success */ - r = array[first]->error; + +if (array[first]) + r = array[first]->error; +else + r =0 ; err_free_fence_array:for (i =0 ; i < fence_count; i++)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1510214382-6807-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byAm 09.11.2017 um 08:59 schrieb Emily Deng:
Quoted 5 lines
The array[first] may be null when the fence has already been signaled.
BUG: SWDEV-136239Signed-off-by Emily Deng <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 12 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0@@ -1502,8 +1502,11 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,memset (wait,0 ,sizeof (*wait)); wait->out.status = (r >0 ); wait->out.first_signaled = first;
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, · line 1512
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5
-2-/* set return value 0 to indicate success */ - r = array[first]->error; + +if (array[first]) + r = array[first]->error; +else + r =0 ; err_free_fence_array:for (i =0 ; i < fence_count; i++)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx