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

Commit a637a43b authored by Puranam V G Tejaswi's avatar Puranam V G Tejaswi
Browse files

msm: kgsl: Use pid struct to find the process to reclaim



Use pid struct instead of tgid to find the correct process private
to be used for reclaim to avoid any sort of issues related to pid reuse.

Change-Id: Ifea6583fb24c6c623d54312865b3fd584ee9fd26
Signed-off-by: default avatarPuranam V G Tejaswi <pvgtejas@codeaurora.org>
parent 851a03f6
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -196,12 +196,21 @@ ssize_t kgsl_proc_max_reclaim_limit_show(struct device *dev,
static int kgsl_reclaim_callback(struct notifier_block *nb,
		unsigned long pid, void *data)
{
	struct kgsl_process_private *process;
	struct kgsl_process_private *p, *process = NULL;
	struct kgsl_mem_entry *entry;
	struct kgsl_memdesc *memdesc;
	int valid_entry, next = 0, ret;

	process = kgsl_process_private_find(pid);
	spin_lock(&kgsl_driver.proclist_lock);
	list_for_each_entry(p, &kgsl_driver.process_list, list) {
		if ((unsigned long)p->pid == pid) {
			if (kgsl_process_private_get(p))
				process = p;
			break;
		}
	}
	spin_unlock(&kgsl_driver.proclist_lock);

	if (!process)
		return NOTIFY_OK;