Skip to contentSkip to conversation

drm/amdgpu: Free resources of bo_list when idr_alloc fails

PATCH In review Alex Xie 3 participants 3 messages Jul 5, 2017 – Jul 6, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Alex Xie

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Free resources of bo_list when idr_alloc fails

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 -1
index efa6903..dc87962 100644
@@ -83,7 +83,7 @@ static int amdgpu_bo_list_create(struct amdgpu_device *adev,
 	r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL);
 	mutex_unlock(&fpriv->bo_list_lock);
 	if (r < 0) {
-		kfree(list);
+		amdgpu_bo_list_free(list);
 		return r;
 	}
 	*id = r;
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1499293623-24544-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org

Reviewed-by Chunming Zhou
#2 lore raw
Quoted 10 lines · Alex Xie
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +0 -0
index efa6903..dc87962 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c static int amdgpu_bo_list_create(struct amdgpu_device *adev, · line 89

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 -1
@@ -83,7 +83,7 @@ static int amdgpu_bo_list_create(struct amdgpu_device *adev,
  	r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL);
  	mutex_unlock(&fpriv->bo_list_lock);
  	if (r < 0) {
-		kfree(list);
+		amdgpu_bo_list_free(list);
  		return r;
  	}
  	*id = r;

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#4 lore raw

Am 06.07.2017 um 04:52 schrieb zhoucm1:

Quoted 19 lines
Quoted 16 lines · Alex Xie
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 -1
index efa6903..dc87962 100644
@@ -83,7 +83,7 @@ static int amdgpu_bo_list_create(struct 
 amdgpu_device *adev,
      r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL);
      mutex_unlock(&fpriv->bo_list_lock);
      if (r < 0) {
-        kfree(list);
+        amdgpu_bo_list_free(list);
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +0 -0
          return r;
      }
      *id = r;

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

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