From: Junwei Zhang Date: Wed, 26 Aug 2015 01:34:59 +0000 (+0800) Subject: drm/amdgpu: adjust the judgement of removing fence callback X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=113cd9dacbad4906e1c8db09233b9fdcb002f80d;p=linux-beck.git drm/amdgpu: adjust the judgement of removing fence callback The fence in the array may be skipped if wait_all is false, thus the related callback is not initialized with list head. So removing this kind callback will cause NULL pointer reference. Signed-off-by: Junwei Zhang Reviewed-by: Jammy Zhou --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 9787337a65a1..f446bf2fedc9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -966,7 +966,7 @@ signed long amdgpu_fence_wait_multiple(struct amdgpu_device *adev, fence_rm_cb: for (idx = 0; idx < count; ++idx) { fence = array[idx]; - if (fence) + if (fence && cb[idx].base.func) fence_remove_callback(fence, &cb[idx].base); }