]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: fix amdgpu_res_first()
authorNirmoy Das <nirmoy.das@amd.com>
Fri, 19 Mar 2021 18:54:31 +0000 (19:54 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:38:47 +0000 (16:38 -0400)
Fix size comparison in the resource cursor.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h

index b49a61d07d605e307a84812fa1c37d4755dcce9e..40f2adf305bc26a3bb7945ee6b68d844b6ff9fc6 100644 (file)
@@ -64,7 +64,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
        BUG_ON(start + size > res->num_pages << PAGE_SHIFT);
 
        node = res->mm_node;
-       while (start > node->size << PAGE_SHIFT)
+       while (start >= node->size << PAGE_SHIFT)
                start -= node++->size << PAGE_SHIFT;
 
        cur->start = (node->start << PAGE_SHIFT) + start;