drm/amdkfd: Fix the error return code in kfd_ioctl_unmap_memory_from_gpu()
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 30 Mar 2018 02:25:17 +0000 (02:25 +0000)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 24 Apr 2018 09:14:55 +0000 (12:14 +0300)
commitded5e5622c38f6d0188c776bfd6793e1cdbb7606
tree52b3f8d03fd32a4efa8a8b88b6ac21b73c86add2
parenta4efd3a4e685df239805ebd57f546904d5821114
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>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c