Commit b3f4bdda authored by Young Xiao's avatar Young Xiao Committed by Alex Deucher

drm: radeon: fix overflow on 32bit systems

the type mem->start is unsigned long, so this can overflow on
32bit system, since the type addr is uint64_t.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarYoung Xiao <YangX92@hotmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ce998149
...@@ -946,7 +946,7 @@ int radeon_vm_bo_update(struct radeon_device *rdev, ...@@ -946,7 +946,7 @@ int radeon_vm_bo_update(struct radeon_device *rdev,
bo_va->flags &= ~RADEON_VM_PAGE_WRITEABLE; bo_va->flags &= ~RADEON_VM_PAGE_WRITEABLE;
if (mem) { if (mem) {
addr = mem->start << PAGE_SHIFT; addr = (u64)mem->start << PAGE_SHIFT;
if (mem->mem_type != TTM_PL_SYSTEM) { if (mem->mem_type != TTM_PL_SYSTEM) {
bo_va->flags |= RADEON_VM_PAGE_VALID; bo_va->flags |= RADEON_VM_PAGE_VALID;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment