From 0b60aad8a5f1e6d38bf2d254fa5209492157e344 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Mon, 12 Mar 2001 18:18:06 +0000 Subject: Try that again... --- linux/radeon_state.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'linux/radeon_state.c') 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; } -- cgit v1.2.3