diff options
author | Felix Kuehling <Felix.Kuehling@amd.com> | 2018-12-14 19:57:02 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-19 01:39:11 +0300 |
commit | e98bdb8061305ec00ca9c11231a606e849477bc8 (patch) | |
tree | 0b9b9841767caba83179eb5722681f1f1d7d4d79 /drivers/gpu | |
parent | 7ab3f021bbc8078e7fbd1d06b6b3105dc010dc0e (diff) | |
download | linux-e98bdb8061305ec00ca9c11231a606e849477bc8.tar.xz |
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 3623538baf6f..db6f27fe3d5a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -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); |