Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ed8147a authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher
Browse files

drm/amdgpu: use failed label to handle context init failure

parent 9982ca68
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -55,10 +55,12 @@ 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) {
	return 0;

failed:
	for (j = 0; j < i; j++)
		amd_sched_entity_fini(&adev->rings[j]->sched,
				      &ctx->rings[j].entity);
@@ -66,8 +68,6 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx)
	ctx->fences = NULL;
	return r;
}
	return 0;
}

static void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)
{