From: Dan Carpenter Date: Fri, 3 Jul 2015 08:54:28 +0000 (+0300) Subject: drm/radeon: fix underflow in r600_cp_dispatch_texture() X-Git-Tag: firefly_0821_release~176^2~1437^2~3^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=866a92040392d844d151aa6a2ba15be2e6e5df4f;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher --- 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)) {