summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/r600_cp.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-07-03 11:54:28 +0300
committerAlex Deucher <alexander.deucher@amd.com>2015-07-08 12:41:43 -0400
commit866a92040392d844d151aa6a2ba15be2e6e5df4f (patch)
treeb82349b0bab19a2031fc90dc88d529af28ddcdf2 /drivers/gpu/drm/radeon/r600_cp.c
parent5e3c4f907043a7fae1b48e86536dc7b9efa07e29 (diff)
drm/radeon: fix underflow in r600_cp_dispatch_texture()
The "if (pass_size > buf->total)" can underflow so I have changed the type of size and pass_size to unsigned to avoid this problem. 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>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_cp.c')
-rw-r--r--drivers/gpu/drm/radeon/r600_cp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
index 09e3f39925fa..98f9adaccc3d 100644
--- a/drivers/gpu/drm/radeon/r600_cp.c
+++ b/drivers/gpu/drm/radeon/r600_cp.c
@@ -2483,7 +2483,7 @@ int r600_cp_dispatch_texture(struct drm_device *dev,
struct drm_buf *buf;
u32 *buffer;
const u8 __user *data;
- int size, pass_size;
+ unsigned int size, pass_size;
u64 src_offset, dst_offset;
if (!radeon_check_offset(dev_priv, tex->offset)) {