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

Commit 2b7e74e4 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Improve the scheduler"

parents 86b9451e 9d8e8013
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -5043,7 +5043,7 @@ bool is_sched_lib_based_app(pid_t pid)
	char *libname, *lib_list;
	struct vm_area_struct *vma;
	char path_buf[LIB_PATH_LENGTH];
	char tmp_lib_name[LIB_PATH_LENGTH];
	char *tmp_lib_name;
	bool found = false;
	struct task_struct *p;
	struct mm_struct *mm;
@@ -5051,11 +5051,16 @@ bool is_sched_lib_based_app(pid_t pid)
	if (strnlen(sched_lib_name, LIB_PATH_LENGTH) == 0)
		return false;

	tmp_lib_name = kmalloc(LIB_PATH_LENGTH, GFP_KERNEL);
	if (!tmp_lib_name)
		return false;

	rcu_read_lock();

	p = find_process_by_pid(pid);
	if (!p) {
		rcu_read_unlock();
		kfree(tmp_lib_name);
		return false;
	}

@@ -5093,6 +5098,7 @@ bool is_sched_lib_based_app(pid_t pid)
	mmput(mm);
put_task_struct:
	put_task_struct(p);
	kfree(tmp_lib_name);
	return found;
}