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

Commit 1ee086da authored by Jimmy Shiu's avatar Jimmy Shiu Committed by DarkJoker360
Browse files

sched: core: fix kmalloc error during spinlock



The patch, pa/1759800, incorrectly used the 'kmalloc(sizeof(...),
GFP_KERNEL)' during spinlock section.

Bug: 173167141
Test: enable CONFIG_PANIC_ON_SCHED_BUG, boot to home
Change-Id: Ifa1619c9b0d3a784a46bc344ec24a4cefd27c91b
Signed-off-by: default avatarJimmy Shiu <jimmyshiu@google.com>
parent 9f61c25f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5115,8 +5115,8 @@ int sysctl_sched_lib_name_handler(struct ctl_table *table, int write,
		strlcpy(dup_sched_lib_name, sched_lib_name, LIB_PATH_LENGTH);
		next = dup_sched_lib_name;
		while ((curr = strsep(&next, ",")) != NULL) {
			pos = kmalloc(sizeof(struct libname_node), GFP_KERNEL);
			pos->name = kstrdup(curr, GFP_KERNEL);
			pos = kmalloc(sizeof(struct libname_node), GFP_ATOMIC);
			pos->name = kstrdup(curr, GFP_ATOMIC);
			list_add_tail(&pos->list, &__sched_lib_name_list);
		}
		spin_unlock(&__sched_lib_name_lock);