Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Alex Deucher
866a9204 5e3c4f90

+1 -1
+1 -1
drivers/gpu/drm/radeon/r600_cp.c
··· 2483 2483 struct drm_buf *buf; 2484 2484 u32 *buffer; 2485 2485 const u8 __user *data; 2486 - int size, pass_size; 2486 + unsigned int size, pass_size; 2487 2487 u64 src_offset, dst_offset; 2488 2488 2489 2489 if (!radeon_check_offset(dev_priv, tex->offset)) {