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 f621ee1..a71b875 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;