diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index a5e2fcbef0f0..6d86eaef934c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -55,18 +55,18 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx) | |||
55 | r = amd_sched_entity_init(&ring->sched, &ctx->rings[i].entity, | 55 | r = amd_sched_entity_init(&ring->sched, &ctx->rings[i].entity, |
56 | rq, amdgpu_sched_jobs); | 56 | rq, amdgpu_sched_jobs); |
57 | if (r) | 57 | if (r) |
58 | break; | 58 | goto failed; |
59 | } | 59 | } |
60 | 60 | ||
61 | if (i < adev->num_rings) { | ||
62 | for (j = 0; j < i; j++) | ||
63 | amd_sched_entity_fini(&adev->rings[j]->sched, | ||
64 | &ctx->rings[j].entity); | ||
65 | kfree(ctx->fences); | ||
66 | ctx->fences = NULL; | ||
67 | return r; | ||
68 | } | ||
69 | return 0; | 61 | return 0; |
62 | |||
63 | failed: | ||
64 | for (j = 0; j < i; j++) | ||
65 | amd_sched_entity_fini(&adev->rings[j]->sched, | ||
66 | &ctx->rings[j].entity); | ||
67 | kfree(ctx->fences); | ||
68 | ctx->fences = NULL; | ||
69 | return r; | ||
70 | } | 70 | } |
71 | 71 | ||
72 | static void amdgpu_ctx_fini(struct amdgpu_ctx *ctx) | 72 | static void amdgpu_ctx_fini(struct amdgpu_ctx *ctx) |