drm/amdgpu: Free resources of bo_list when idr_alloc fails
authorAlex Xie <AlexBin.Xie@amd.com>
Wed, 5 Jul 2017 22:02:04 +0000 (18:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jul 2017 15:06:17 +0000 (11:06 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c

index f621ee115c98d4e5d5a4faa0d845864dc65a0b8c..a71b875d0503a95a0cc8b30a7302dc087a8f015f 100644 (file)
@@ -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;