hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/sparc/kernel/cpumap.c
....@@ -50,7 +50,7 @@
5050
5151 /* Offsets into nodes[] for each level of the tree */
5252 struct cpuinfo_level level[CPUINFO_LVL_MAX];
53
- struct cpuinfo_node nodes[0];
53
+ struct cpuinfo_node nodes[];
5454 };
5555
5656
....@@ -194,8 +194,7 @@
194194
195195 n = enumerate_cpuinfo_nodes(tmp_level);
196196
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);
199198 if (!new_tree)
200199 return NULL;
201200