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

Commit f30f4066 authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Free allocated memory on early return



Make sure the allocated memory is freed before returning.

Change-Id: I6da7d1ffbd83ad206970e38ac99f9da211ffe86c
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent bd4743e8
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -824,16 +824,16 @@ static int _set_pagetable_gpu(struct adreno_ringbuffer *rb,
	int result;

	link = kmalloc(PAGE_SIZE, GFP_KERNEL);
	if (link == NULL) {
		result = -ENOMEM;
		goto done;
	}
	if (link == NULL)
		return -ENOMEM;

	cmds = link;

	/* If we are in a fault the MMU will be reset soon */
	if (test_bit(ADRENO_DEVICE_FAULT, &adreno_dev->priv))
	if (test_bit(ADRENO_DEVICE_FAULT, &adreno_dev->priv)) {
		kfree(link);
		return 0;
	}

	kgsl_mmu_enable_clk(&device->mmu);

@@ -861,7 +861,6 @@ static int _set_pagetable_gpu(struct adreno_ringbuffer *rb,
		adreno_ringbuffer_mmu_disable_clk_on_ts(device, rb,
						rb->timestamp);

done:
	kfree(link);
	return result;
}