[PATCH] check page allocations in ia32 support code

From: Greg Edwards <edwardsg_at_sgi.com>
Date: 2004-08-12 06:33:53
It's pretty unlikely these page allocations would fail, but we should
still check them.

Signed-off-by: Greg Edwards <edwardsg@sgi.com>

Greg


 ia32_support.c |    6 ++++++
 1 files changed, 6 insertions(+)

Index: work-26x-bk/arch/ia64/ia32/ia32_support.c
===================================================================
--- work-26x-bk.orig/arch/ia64/ia32/ia32_support.c	2004-07-29 14:38:04.000000000 -0500
+++ work-26x-bk/arch/ia64/ia32/ia32_support.c	2004-08-11 15:17:55.000000000 -0500
@@ -145,6 +145,9 @@ ia32_gdt_init (void)
 	int cpu = smp_processor_id();
 
 	ia32_shared_page[cpu] = alloc_page(GFP_KERNEL);
+	if (!ia32_shared_page[cpu])
+		panic("failed to allocate ia32_shared_page[%d]\n", cpu);
+
 	cpu_gdt_table[cpu] = page_address(ia32_shared_page[cpu]);
 
 	/* Copy from the boot cpu's GDT */
@@ -161,6 +164,9 @@ ia32_boot_gdt_init (void)
 	unsigned long ldt_size;
 
 	ia32_shared_page[0] = alloc_page(GFP_KERNEL);
+	if (!ia32_shared_page[0])
+		panic("failed to allocate ia32_shared_page[0]\n");
+
 	ia32_boot_gdt = page_address(ia32_shared_page[0]);
 	cpu_gdt_table[0] = ia32_boot_gdt;
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Aug 11 16:41:38 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:29 EST