Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path

PATCH In review Christian König 2 participants 2 messages Sep 3, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix amdgpu_mn_unlock() in the CS error path

Avoid unlocking a lock we never locked.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
index 349dcc37ee64..04a2733b5ccc 100644
@@ -1247,10 +1247,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;
 }
 
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180903085301.2083-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by Junwei Zhang
#2 lore raw
Quoted 3 lines · Christian König

Avoid unlocking a lock we never locked.

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -0
index 349dcc37ee64..04a2733b5ccc 100644
@@ -1247,10 +1247,10 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
  error_abort:

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · line 1256

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
  	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;
  }
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx