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

Commit f9416d64 authored by Kamal Agrawal's avatar Kamal Agrawal Committed by Hareesh Gundu
Browse files

msm: kgsl: Remove debugfs directory inside lock



In kgsl_process_private_close, debugfs directory is removed after mutex
is unlocked. Considering this, a race can be created between
kgsl_process_private_close and kgsl_process_init_debugfs. Fix it by
moving debugfs directory removal inside lock.

Change-Id: Ida65ab8a3825d8c695c56556860495cce853117c
Signed-off-by: default avatarKamal Agrawal <kamaagra@codeaurora.org>
parent 970f4dd4
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -1071,16 +1071,15 @@ static void kgsl_process_private_close(struct kgsl_device_private *dev_priv,
	list_del(&private->list);
	spin_unlock(&kgsl_driver.proclist_lock);

	debugfs_remove_recursive(private->debug_root);

	/*
	 * Unlock the mutex before releasing the memory and the debugfs
	 * nodes - this prevents deadlocks with the IOMMU and debugfs
	 * locks.
	 * Unlock the mutex before releasing the memory - this prevents a
	 * deadlock with the IOMMU mutex if a page fault occurs.
	 */
	mutex_unlock(&kgsl_driver.process_mutex);

	process_release_memory(private);
	debugfs_remove_recursive(private->debug_root);

	kgsl_process_private_put(private);
}