drm/amdgpu: fix list add issue in vram reserve
authorTao Zhou <tao.zhou1@amd.com>
Sun, 30 Jan 2022 07:17:32 +0000 (15:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Feb 2022 23:01:16 +0000 (18:01 -0500)
The parameter order in the list_add_tail is incorrect, it causes the
reuse of ras reserved page.

Signed-off-by: Tao Zhou <tao.zhou1@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_vram_mgr.c

index 7a2b487db57c91ccde53e783cade0b9e0d7c42e9..6c99ef700cc82d182dc5bab40809e63baf142962 100644 (file)
@@ -281,7 +281,7 @@ int amdgpu_vram_mgr_reserve_range(struct amdgpu_vram_mgr *mgr,
        rsv->mm_node.size = size >> PAGE_SHIFT;
 
        spin_lock(&mgr->lock);
-       list_add_tail(&mgr->reservations_pending, &rsv->node);
+       list_add_tail(&rsv->node, &mgr->reservations_pending);
        amdgpu_vram_mgr_do_reserve(&mgr->manager);
        spin_unlock(&mgr->lock);