Skip to content

Commit

Permalink
drm/amdgpu: fix amdgpu_res_first()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nirmoy Das committed Mar 21, 2021
1 parent e8af38e commit ccceccf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ccceccf

Please sign in to comment.