Commit e98bdb80 authored by Felix Kuehling's avatar Felix Kuehling Committed by Alex Deucher
Browse files

drm/amdkfd: Fix handling of return code of dma_buf_get



On errors, dma_buf_get returns a negative error code, rather than NULL.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7ab3f021
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1629,8 +1629,8 @@ static int kfd_ioctl_import_dmabuf(struct file *filep,
		return -EINVAL;

	dmabuf = dma_buf_get(args->dmabuf_fd);
	if (!dmabuf)
		return -EINVAL;
	if (IS_ERR(dmabuf))
		return PTR_ERR(dmabuf);

	mutex_lock(&p->mutex);