[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>
This commit is contained in:
Родитель
7682a4c624
Коммит
a813213d73
|
@ -67,10 +67,8 @@ static int __init topology_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
|
sysfs_cpus = kzalloc(sizeof(struct ia64_cpu) * NR_CPUS, GFP_KERNEL);
|
||||||
if (!sysfs_cpus) {
|
if (!sysfs_cpus)
|
||||||
err = -ENOMEM;
|
panic("kzalloc in topology_init failed - NR_CPUS too big?");
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
for_each_present_cpu(i) {
|
for_each_present_cpu(i) {
|
||||||
if((err = arch_register_cpu(i)))
|
if((err = arch_register_cpu(i)))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче