From b3f4bdda998be6018b76f46b852313ae74db5606 Mon Sep 17 00:00:00 2001 From: Young Xiao Date: Tue, 27 Nov 2018 11:50:17 +0000 Subject: [PATCH] drm: radeon: fix overflow on 32bit systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the type mem->start is unsigned long, so this can overflow on 32bit system, since the type addr is uint64_t. Reviewed-by: Christian König Signed-off-by: Young Xiao Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index fed11ece0de6..a3d2ca07a058 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c @@ -946,7 +946,7 @@ int radeon_vm_bo_update(struct radeon_device *rdev, bo_va->flags &= ~RADEON_VM_PAGE_WRITEABLE; if (mem) { - addr = mem->start << PAGE_SHIFT; + addr = (u64)mem->start << PAGE_SHIFT; if (mem->mem_type != TTM_PL_SYSTEM) { bo_va->flags |= RADEON_VM_PAGE_VALID; }