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

Commit c79cda34 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Initialize drawctxt active node earlier



gpudev->preemption_context_init() can fail and invoke
adreno_drawctxt_detach(). This causes a crash because
drawctxt->active_node is not initialized.

Change-Id: I201759316cfa5dc831e1987d209c73efb97bb9ee
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 817655d5
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -401,6 +401,13 @@ adreno_drawctxt_create(struct kgsl_device_private *dev_priv,

	adreno_context_debugfs_init(ADRENO_DEVICE(device), drawctxt);

	if (!test_bit(GMU_DISPATCH, &device->gmu_core.flags)) {
		/* set the context ringbuffer */
		drawctxt->rb = adreno_ctx_get_rb(adreno_dev, drawctxt);

		INIT_LIST_HEAD(&drawctxt->active_node);
	}

	if (gpudev->preemption_context_init) {
		ret = gpudev->preemption_context_init(&drawctxt->base);
		if (ret != 0) {
@@ -412,13 +419,6 @@ adreno_drawctxt_create(struct kgsl_device_private *dev_priv,
	/* copy back whatever flags we dediced were valid */
	*flags = drawctxt->base.flags;

	if (!test_bit(GMU_DISPATCH, &device->gmu_core.flags)) {
		/* set the context ringbuffer */
		drawctxt->rb = adreno_ctx_get_rb(adreno_dev, drawctxt);

		INIT_LIST_HEAD(&drawctxt->active_node);
	}

	return &drawctxt->base;
}