aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/topology.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel/topology.c')
-rw-r--r--arch/ia64/kernel/topology.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 706b7734e191..6e5eea19fa67 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -71,31 +71,33 @@ static int __init topology_init(void)
71 int i, err = 0; 71 int i, err = 0;
72 72
73#ifdef CONFIG_NUMA 73#ifdef CONFIG_NUMA
74 sysfs_nodes = kmalloc(sizeof(struct node) * MAX_NUMNODES, GFP_KERNEL); 74 sysfs_nodes = kzalloc(sizeof(struct node) * MAX_NUMNODES, GFP_KERNEL);
75 if (!sysfs_nodes) { 75 if (!sysfs_nodes) {
76 err = -ENOMEM; 76 err = -ENOMEM;
77 goto out; 77 goto out;
78 } 78 }
79 memset(sysfs_nodes, 0, sizeof(struct node) * MAX_NUMNODES);
80 79
81 /* MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes? */ 80 /*
82 for_each_online_node(i) 81 * MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes?
82 */
83 for_each_online_node(i) {
83 if ((err = register_node(&sysfs_nodes[i], i, 0))) 84 if ((err = register_node(&sysfs_nodes[i], i, 0)))
84 goto out; 85 goto out;
86 }
85#endif 87#endif
86 88
87 sysfs_cpus = kmalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL); 89 sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
88 if (!sysfs_cpus) { 90 if (!sysfs_cpus) {
89 err = -ENOMEM; 91 err = -ENOMEM;
90 goto out; 92 goto out;
91 } 93 }
92 memset(sysfs_cpus, 0, sizeof(struct ia64_cpu) * NR_CPUS);
93 94
94 for_each_present_cpu(i) 95 for_each_present_cpu(i) {
95 if((err = arch_register_cpu(i))) 96 if((err = arch_register_cpu(i)))
96 goto out; 97 goto out;
98 }
97out: 99out:
98 return err; 100 return err;
99} 101}
100 102
101__initcall(topology_init); 103subsys_initcall(topology_init);