kernel/arch/sparc/kernel/cpumap.c
.. .. @@ -50,7 +50,7 @@ 50 50 51 51 /* Offsets into nodes[] for each level of the tree */ 52 52 struct cpuinfo_level level[CPUINFO_LVL_MAX]; 53 - struct cpuinfo_node nodes[0];53 + struct cpuinfo_node nodes[];54 54 }; 55 55 56 56 .. .. @@ -194,8 +194,7 @@ 194 194 195 195 n = enumerate_cpuinfo_nodes(tmp_level); 196 196 197 - new_tree = kzalloc(sizeof(struct cpuinfo_tree) +198 - (sizeof(struct cpuinfo_node) * n), GFP_ATOMIC);197 + new_tree = kzalloc(struct_size(new_tree, nodes, n), GFP_ATOMIC);199 198 if (!new_tree) 200 199 return NULL; 201 200