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

Commit 87b1dc2a authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Stephen Boyd
Browse files

msm: kgsl: Check pagetable pointer before dereferencing it



Make sure that pagetable pointer is valid before dereferencing the
pointer. The pagetable pointer may be invalid if a new process is
added to the process private list and its pagetable is not yet
initialized. This can happen because a process private pointer is
added to the list and this list is guarded by kgsl driver mutex,
but the initialization of the process private pointer happens
later after the kgsl driver mutex is unlocked. So this can cause a
situation where a process private pointer is on the list but its
pagetable is not yet initialized.

CRs-Fixed: 490374
Change-Id: I2807ac557d9b640b2ca1e02f88f245cc87abcff4
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 9196c1ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static void _find_mem_entries(struct kgsl_mmu *mmu, unsigned int faultaddr,

	list_for_each_entry(private, &kgsl_driver.process_list, list) {

		if (private->pagetable->name != id)
		if (private->pagetable && (private->pagetable->name != id))
			continue;

		spin_lock(&private->mem_lock);