Skip to contentSkip to conversation

drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator

PATCH In review jimqu 1 participant 2 messages Nov 1, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

jimqu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator

Change-Id Id960af4bf93036a8a39306c374e2cafdc1bef055
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +3 -3
index 180eed7c..6933f4a 100644
@@ -100,7 +100,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
 	enum drm_mm_search_flags sflags = DRM_MM_SEARCH_DEFAULT;
 	enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT;
 	unsigned long lpfn, num_nodes, pages_per_node, pages_left;
-	unsigned i;
+	unsigned i, j;
 	int r;
 
 	lpfn = place->lpfn;
@@ -155,8 +155,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
 	return 0;
 
 error:
-	while (i--)
-		drm_mm_remove_node(&nodes[i]);
+	for (j = 0; j < i; j++)
+		drm_mm_remove_node(&nodes[j]);
 	spin_unlock(&mgr->lock);
 
 	kfree(nodes);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#2 lore raw
In reply to a message not in the archive

Please ignore this patch. I make a mistake.

Thanks
JimQu

________________________________________
发件人: jimqu <[email protected]>
发送时间: 2016年11月1日 17:21
收件人: [email protected]
抄送: Qu, Jim
主题: [PATCH] drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator

Change-Id Id960af4bf93036a8a39306c374e2cafdc1bef055
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +3 -3
index 180eed7c..6933f4a 100644
@@ -100,7 +100,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
        enum drm_mm_search_flags sflags = DRM_MM_SEARCH_DEFAULT;
        enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT;
        unsigned long lpfn, num_nodes, pages_per_node, pages_left;
-       unsigned i;
+       unsigned i, j;
        int r;
 
        lpfn = place->lpfn;
@@ -155,8 +155,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
        return 0;
 
 error:
-       while (i--)
-               drm_mm_remove_node(&nodes[i]);
+       for (j = 0; j < i; j++)
+               drm_mm_remove_node(&nodes[j]);
        spin_unlock(&mgr->lock);
 
        kfree(nodes);

--
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx