drm/amdgpu: cleanup on error in amdgpu_cs_ioctl()
[deliverable/linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_cs.c
index 8727c3099554b48bdea0dce69c9d4afaedfe340c..233ac9c64eb3abaa28f8a1fde51e1fb78de81e2f 100644 (file)
@@ -875,8 +875,10 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                struct amdgpu_job *job;
                struct amdgpu_ring * ring =  parser->ibs->ring;
                job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
-               if (!job)
-                       return -ENOMEM;
+               if (!job) {
+                       r = -ENOMEM;
+                       goto out;
+               }
                job->base.sched = &ring->sched;
                job->base.s_entity = &parser->ctx->rings[ring->idx].entity;
                job->adev = parser->adev;
This page took 0.023997 seconds and 5 git commands to generate.