drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path
authorChristian König <christian.koenig@amd.com>
Mon, 3 Sep 2018 08:51:51 +0000 (10:51 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Sep 2018 03:53:29 +0000 (22:53 -0500)
Avoid unlocking a lock we never locked.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index b6e9df11115d358734d686af7b26a9eec0a6de64..1b5a0a73d7706cd32e6ada2231e8451a6400d29a 100644 (file)
@@ -1262,10 +1262,10 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 error_abort:
        dma_fence_put(&job->base.s_fence->finished);
        job->base.s_fence = NULL;
+       amdgpu_mn_unlock(p->mn);
 
 error_unlock:
        amdgpu_job_free(job);
-       amdgpu_mn_unlock(p->mn);
        return r;
 }