aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-11-04 08:25:09 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-11-04 12:29:21 -0500
commit4cfdcd9cecc05646b08805ba449811a645b3f4a8 (patch)
tree8671c0bb0272a75a644e8ae0b83dbe70d60778b2 /drivers/gpu
parenta7ca8ef93001eaab4c5c7f4f3accfbe6ffcf5f26 (diff)
drm/amdgpu: cleanup on error in amdgpu_cs_ioctl()
We recently changed the locking in this function and now there is a missing unlock on error. Also there are some other resources that we should probably release as well... Fixes: f48b2659f521 ('drm/amdgpu: fix the broken vm->mutex V2') Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 8727c3099554..233ac9c64eb3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -875,8 +875,10 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
875 struct amdgpu_job *job; 875 struct amdgpu_job *job;
876 struct amdgpu_ring * ring = parser->ibs->ring; 876 struct amdgpu_ring * ring = parser->ibs->ring;
877 job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL); 877 job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
878 if (!job) 878 if (!job) {
879 return -ENOMEM; 879 r = -ENOMEM;
880 goto out;
881 }
880 job->base.sched = &ring->sched; 882 job->base.sched = &ring->sched;
881 job->base.s_entity = &parser->ctx->rings[ring->idx].entity; 883 job->base.s_entity = &parser->ctx->rings[ring->idx].entity;
882 job->adev = parser->adev; 884 job->adev = parser->adev;