Sfoglia il codice sorgente

drm/amdgpu: Free resources of bo_list when idr_alloc fails

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König<christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Xie 8 anni fa
parent
commit
a5d20c405a
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c

+ 1 - 1
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c

@@ -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);
 	r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL);
 	mutex_unlock(&fpriv->bo_list_lock);
 	mutex_unlock(&fpriv->bo_list_lock);
 	if (r < 0) {
 	if (r < 0) {
-		kfree(list);
+		amdgpu_bo_list_free(list);
 		return r;
 		return r;
 	}
 	}
 	*id = r;
 	*id = r;