فهرست منبع

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 <Jerry.Zhang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Junwei Zhang 10 سال پیش
والد
کامیت
113cd9dacb
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

+ 1 - 1
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);
 	}