diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-03-30 02:25:17 +0000 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2018-04-24 12:14:55 +0300 |
commit | ded5e5622c38f6d0188c776bfd6793e1cdbb7606 (patch) | |
tree | 52b3f8d03fd32a4efa8a8b88b6ac21b73c86add2 /drivers/gpu | |
parent | a4efd3a4e685df239805ebd57f546904d5821114 (diff) | |
download | linux-ded5e5622c38f6d0188c776bfd6793e1cdbb7606.tar.gz linux-ded5e5622c38f6d0188c776bfd6793e1cdbb7606.tar.bz2 linux-ded5e5622c38f6d0188c776bfd6793e1cdbb7606.zip |
drm/amdkfd: Fix the error return code in kfd_ioctl_unmap_memory_from_gpu()
Passing NULL pointer to PTR_ERR will result in return value of 0
indicating success which is clearly not what it is intended here.
This patch returns -EINVAL instead.
v2: change ret code to -ENODEV
Fixes: 5ec7e02854b3 ("drm/amdkfd: Add ioctls for GPUVM memory management")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index fb5d997e4148..f65e0142d42e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1421,7 +1421,7 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, pdd = kfd_get_process_device_data(dev, p); if (!pdd) { - err = PTR_ERR(pdd); + err = -EINVAL; goto bind_process_to_device_failed; } |