diff options
author | Paul Jackson <pj@sgi.com> | 2006-08-15 01:45:49 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-08-24 11:29:24 -0400 |
commit | a813213d73bb29d6986c3e93669a9cd5f7984364 (patch) | |
tree | eaeb242ce68a6467d6c740d1c62d2f3945e5be25 /arch/ia64 | |
parent | 7682a4c624e0011b5f3e8dd3021dc54961260d97 (diff) |
[IA64] panic if topology_init kzalloc fails
There really is no sense trying to continue if the kzalloc of sysfs_cpus[]
fails in ia64 topology_init. The code calling into here doesn't check
errors very well, and one ends up with a nonobvious boot failure that
wastes peoples time debugging.
See for example the lkml thread at:
http://lkml.org/lkml/2006/3/2/215
Since the system is totally dead when this kzalloc fails, not having yet
even booted, might as well announce one's death boldly and plainly.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/topology.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index d24fa393b182..f648c610b10c 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -67,10 +67,8 @@ static int __init topology_init(void) | |||
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL); | 69 | sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL); |
70 | if (!sysfs_cpus) { | 70 | if (!sysfs_cpus) |
71 | err = -ENOMEM; | 71 | panic("kzalloc in topology_init failed - NR_CPUS too big?"); |
72 | goto out; | ||
73 | } | ||
74 | 72 | ||
75 | for_each_present_cpu(i) { | 73 | for_each_present_cpu(i) { |
76 | if((err = arch_register_cpu(i))) | 74 | if((err = arch_register_cpu(i))) |