Skip to contentSkip to conversation

drm/ttm: return -EFAULT on copy_to_user error

PATCH New Dan Carpenter 1 participant 1 message Jun 3, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: return -EFAULT on copy_to_user error

copy_to/from_user() returns the number of bytes remaining and this function normally returns negative error codes. No one uses the ttm_bo_fbdev_io() function so this change has no impact.

drivers/gpu/drm/ttm/ttm_bo_vm.c +1 -1
index fe6cb77..fe4a25a 100644
@@ -444,7 +444,7 @@ ssize_t ttm_bo_fbdev_io(struct ttm_buffer_object *bo, const char __user *wbuf,
 	ttm_bo_unref(&bo);
 
 	if (unlikely(ret != 0))
-		return ret;
+		return -EFAULT;
 
 	*f_pos += io_size;