diff options
author | James Morris <james.l.morris@oracle.com> | 2014-06-24 10:46:07 +0200 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2014-06-24 10:46:07 +0200 |
commit | f01387d2693813eb5271a3448e6a082322c7d75d (patch) | |
tree | b591ca73c85276bae53d7db57ff1565be45a29da /kernel/sched/cpupri.c | |
parent | Merge branch 'next' of git://git.infradead.org/users/pcmoore/selinux into next (diff) | |
parent | Linux 3.15 (diff) | |
download | linux-f01387d2693813eb5271a3448e6a082322c7d75d.tar.xz linux-f01387d2693813eb5271a3448e6a082322c7d75d.zip |
Merge commit 'v3.15' into next
Diffstat (limited to 'kernel/sched/cpupri.c')
-rw-r--r-- | kernel/sched/cpupri.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 8b836b376d91..8834243abee2 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -30,6 +30,7 @@ #include <linux/gfp.h> #include <linux/sched.h> #include <linux/sched/rt.h> +#include <linux/slab.h> #include "cpupri.h" /* Convert between a 140 based task->prio, and our 102 based cpupri */ @@ -70,8 +71,7 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, int idx = 0; int task_pri = convert_prio(p->prio); - if (task_pri >= MAX_RT_PRIO) - return 0; + BUG_ON(task_pri >= CPUPRI_NR_PRIORITIES); for (idx = 0; idx < task_pri; idx++) { struct cpupri_vec *vec = &cp->pri_to_cpu[idx]; @@ -219,8 +219,13 @@ int cpupri_init(struct cpupri *cp) goto cleanup; } + cp->cpu_to_pri = kcalloc(nr_cpu_ids, sizeof(int), GFP_KERNEL); + if (!cp->cpu_to_pri) + goto cleanup; + for_each_possible_cpu(i) cp->cpu_to_pri[i] = CPUPRI_INVALID; + return 0; cleanup: @@ -237,6 +242,7 @@ void cpupri_cleanup(struct cpupri *cp) { int i; + kfree(cp->cpu_to_pri); for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) free_cpumask_var(cp->pri_to_cpu[i].mask); } |