summaryrefslogtreecommitdiff
path: root/linux/radeon_state.c
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2001-03-12 18:18:06 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2001-03-12 18:18:06 +0000
commit0b60aad8a5f1e6d38bf2d254fa5209492157e344 (patch)
tree3117212742bc3d57e97afe8cd2287d3c12df7af2 /linux/radeon_state.c
parent134aecdeed19a339a147d7e88fc9b722b9794245 (diff)
Try that again...
Diffstat (limited to 'linux/radeon_state.c')
-rw-r--r--linux/radeon_state.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/linux/radeon_state.c b/linux/radeon_state.c
index 816e63bd..9360c43b 100644
--- a/linux/radeon_state.c
+++ b/linux/radeon_state.c
@@ -1054,8 +1054,10 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
image->height -= height;
image->data = (char *)image->data + size;
- if ( copy_to_user( tex->image, image, sizeof(*image) ) )
+ if ( copy_to_user( tex->image, image, sizeof(*image) ) ) {
+ DRM_ERROR( "EFAULT on tex->image\n" );
return -EFAULT;
+ }
} else if ( size < 4 ) {
size = 4;
}
@@ -1089,16 +1091,21 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
/* Texture image width is larger than the minimum, so we
* can upload it directly.
*/
- if ( copy_from_user( buffer, data, dwords * sizeof(u32) ) )
+ if ( copy_from_user( buffer, data, dwords * sizeof(u32) ) ) {
+ DRM_ERROR( "EFAULT on data, %d dwords\n", dwords );
return -EFAULT;
+ }
} else {
/* Texture image width is less than the minimum, so we
* need to pad out each image scanline to the minimum
* width.
*/
for ( i = 0 ; i < tex->height ; i++ ) {
- if ( copy_from_user( buffer, data, tex_width ) )
+ if ( copy_from_user( buffer, data, tex_width ) ) {
+ DRM_ERROR( "EFAULT on pad, %d bytes\n",
+ tex_width );
return -EFAULT;
+ }
buffer += 8;
data += tex_width;
}