mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 15:16:43 +07:00
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>
This commit is contained in:
parent
7ab3f021bb
commit
e98bdb8061
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user