]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: CRIU return -EFAULT for copy_to_user() failure
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Feb 2022 18:09:59 +0000 (21:09 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Feb 2022 21:10:06 +0000 (16:10 -0500)
commitc03c19c5c78040a4bb76dd7f3cb258f962e662c1
treef7ff1d37e7d806b9a75f822b6be5018be4f12df2
parent1dcb9c1ee936777189299370ddcc62518f9d11cd
drm/amdkfd: CRIU return -EFAULT for copy_to_user() failure

If copy_to_user() fails, it returns the number of bytes remaining to
be copied but we want to return a negative error code (-EFAULT) to the
user.

Fixes: 417143194857 ("drm/amdkfd: CRIU Save Shared Virtual Memory ranges")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Yat Sin <david.yatsin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c