From: Alex Xie Date: Wed, 5 Jul 2017 22:02:04 +0000 (-0400) Subject: drm/amdgpu: Free resources of bo_list when idr_alloc fails X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a5d20c405a37db7e59089422e795ad58feb37638;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: Free resources of bo_list when idr_alloc fails Signed-off-by: Alex Xie Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher --- 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, 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;