drm/amdgpu: use failed label to handle context init failure
Subsystems (2)
PATCH 1/1 drm/amdgpu: use failed label to handle context init failure
Signed-off-by Huang Rui <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +9 -9
@@ -56,18 +56,18 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx) r =amd_sched_entity_init (&ring->sched, &ctx->rings[i].entity, rq, amdgpu_sched_jobs);if (r) -break ; + goto failed; } -if (i < adev->num_rings) { -for (j =0 ; j < i; j++) -amd_sched_entity_fini (&adev->rings[j]->sched, - &ctx->rings[j].entity); -kfree (ctx->fences); - ctx->fences =NULL ; -return r; - }return 0 ; + +failed: +for (j =0 ; j < i; j++) +amd_sched_entity_fini (&adev->rings[j]->sched, + &ctx->rings[j].entity); +kfree (ctx->fences); + ctx->fences =NULL ; +return r; }static void amdgpu_ctx_fini (struct amdgpu_ctx *ctx)
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1477473118-27889-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byQuoted 1 line · Huang Rui
Signed-off-by Huang Rui <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 39 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +9
-10@@ -56,18 +56,18 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx) r =amd_sched_entity_init (&ring->sched, &ctx->rings[i].entity, rq, amdgpu_sched_jobs);if (r) -break ; + goto failed; } -if (i < adev->num_rings) { -for (j =0 ; j < i; j++) -amd_sched_entity_fini (&adev->rings[j]->sched, - &ctx->rings[j].entity); -kfree (ctx->fences); - ctx->fences =NULL ; -return r; - }return 0 ; + +failed: +for (j =0 ; j < i; j++) +amd_sched_entity_fini (&adev->rings[j]->sched, + &ctx->rings[j].entity); +kfree (ctx->fences); + ctx->fences =NULL ; +return r; }static void amdgpu_ctx_fini (struct amdgpu_ctx *ctx) --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx