diff options
author | Alex Xie <AlexBin.Xie@amd.com> | 2017-07-05 18:02:04 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:17 -0400 |
commit | a5d20c405a37db7e59089422e795ad58feb37638 (patch) | |
tree | 302fc5b6209a858fe14ba3901e84a39877f5f474 /drivers/gpu | |
parent | 74c31c6e61f3f903799986a07ab5b7c7437d456a (diff) |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index f621ee115c98..a71b875d0503 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | |||
@@ -83,7 +83,7 @@ static int amdgpu_bo_list_create(struct amdgpu_device *adev, | |||
83 | r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL); | 83 | r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL); |
84 | mutex_unlock(&fpriv->bo_list_lock); | 84 | mutex_unlock(&fpriv->bo_list_lock); |
85 | if (r < 0) { | 85 | if (r < 0) { |
86 | kfree(list); | 86 | amdgpu_bo_list_free(list); |
87 | return r; | 87 | return r; |
88 | } | 88 | } |
89 | *id = r; | 89 | *id = r; |