From: Christian König Date: Mon, 3 Dec 2018 13:05:34 +0000 (+0100) Subject: drm/amdgpu: fix NULL fence handling in amdgpu_cs_fence_to_handle_ioctl X-Git-Tag: v5.0-rc1~13^2~1^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e9177134e7dd992dd96875143413dbc303f355e;p=thirdparty%2Fkernel%2Flinux.git drm/amdgpu: fix NULL fence handling in amdgpu_cs_fence_to_handle_ioctl When the fence is already signaled it is perfectly normal to get a NULL fence here. But since we can't export that we need to use a stub fence. Signed-off-by: Christian König Reviewed-by: Chunming Zhou 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 5dc3ee372e2f9..149b3065119b6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1428,6 +1428,9 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data, if (IS_ERR(fence)) return PTR_ERR(fence); + if (!fence) + fence = dma_fence_get_stub(); + switch (info->in.what) { case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ: r = drm_syncobj_create(&syncobj, 0, fence);