drm/amdgpu: fix overflow on 32bit systems
authorChristian König <christian.koenig@amd.com>
Mon, 7 Sep 2015 10:32:09 +0000 (12:32 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Sep 2015 21:23:33 +0000 (17:23 -0400)
mem->start is a long, so this can overflow on 32bit systems.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index f68b7cdc370a8694bb489e97c82d27e490e3c3b0..b68dcb9edacdf7c6dd1401e603781ba2c62e10b4 100644 (file)
@@ -855,7 +855,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
        int r;
 
        if (mem) {
-               addr = mem->start << PAGE_SHIFT;
+               addr = (u64)mem->start << PAGE_SHIFT;
                if (mem->mem_type != TTM_PL_TT)
                        addr += adev->vm_manager.vram_base_offset;
        } else {