]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Feb 2020 12:07:59 +0000 (15:07 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Feb 2020 21:04:41 +0000 (16:04 -0500)
commite83356d01b56855e986148b06ec1a2d90d2c15a7
tree6fe9206773f3b665865e2c534cd93708a961d6eb
parentba4a13abca0078ef683ec06d0e4b3d75e4fbbb20
drm/amdgpu: return -EFAULT if copy_to_user() fails

The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return a negative error code to the user.

Fixes: e0989bcc0062 ("drm/amdgpu: use amdgpu_device_vram_access in amdgpu_ttm_vram_read")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c