File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 30
30
#include <linux/gfp.h>
31
31
#include <linux/sched.h>
32
32
#include <linux/sched/rt.h>
33
+ #include <linux/slab.h>
33
34
#include "cpupri.h"
34
35
35
36
/* Convert between a 140 based task->prio, and our 102 based cpupri */
@@ -218,8 +219,13 @@ int cpupri_init(struct cpupri *cp)
218
219
goto cleanup ;
219
220
}
220
221
222
+ cp -> cpu_to_pri = kcalloc (nr_cpu_ids , sizeof (int ), GFP_KERNEL );
223
+ if (!cp -> cpu_to_pri )
224
+ goto cleanup ;
225
+
221
226
for_each_possible_cpu (i )
222
227
cp -> cpu_to_pri [i ] = CPUPRI_INVALID ;
228
+
223
229
return 0 ;
224
230
225
231
cleanup :
@@ -236,6 +242,7 @@ void cpupri_cleanup(struct cpupri *cp)
236
242
{
237
243
int i ;
238
244
245
+ kfree (cp -> cpu_to_pri );
239
246
for (i = 0 ; i < CPUPRI_NR_PRIORITIES ; i ++ )
240
247
free_cpumask_var (cp -> pri_to_cpu [i ].mask );
241
248
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ struct cpupri_vec {
17
17
18
18
struct cpupri {
19
19
struct cpupri_vec pri_to_cpu [CPUPRI_NR_PRIORITIES ];
20
- int cpu_to_pri [ NR_CPUS ] ;
20
+ int * cpu_to_pri ;
21
21
};
22
22
23
23
#ifdef CONFIG_SMP
You can’t perform that action at this time.
0 commit comments