diff options
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 750612751a7f..d29950a60411 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -5243,10 +5243,9 @@ static struct ctl_table sd_ctl_root[] = { | |||
5243 | static struct ctl_table *sd_alloc_ctl_entry(int n) | 5243 | static struct ctl_table *sd_alloc_ctl_entry(int n) |
5244 | { | 5244 | { |
5245 | struct ctl_table *entry = | 5245 | struct ctl_table *entry = |
5246 | kmalloc(n * sizeof(struct ctl_table), GFP_KERNEL); | 5246 | kcalloc(n, sizeof(struct ctl_table), GFP_KERNEL); |
5247 | 5247 | ||
5248 | BUG_ON(!entry); | 5248 | BUG_ON(!entry); |
5249 | memset(entry, 0, n * sizeof(struct ctl_table)); | ||
5250 | 5249 | ||
5251 | return entry; | 5250 | return entry; |
5252 | } | 5251 | } |
@@ -6018,7 +6017,7 @@ static int build_sched_domains(const cpumask_t *cpu_map) | |||
6018 | /* | 6017 | /* |
6019 | * Allocate the per-node list of sched groups | 6018 | * Allocate the per-node list of sched groups |
6020 | */ | 6019 | */ |
6021 | sched_group_nodes = kzalloc(sizeof(struct sched_group *)*MAX_NUMNODES, | 6020 | sched_group_nodes = kcalloc(MAX_NUMNODES, sizeof(struct sched_group *), |
6022 | GFP_KERNEL); | 6021 | GFP_KERNEL); |
6023 | if (!sched_group_nodes) { | 6022 | if (!sched_group_nodes) { |
6024 | printk(KERN_WARNING "Can not alloc sched group node list\n"); | 6023 | printk(KERN_WARNING "Can not alloc sched group node list\n"); |