[PATCH] fix xenU kernel crash in dmi_iterate

From: Rik van Riel
Date: Fri Jan 14 2005 - 14:52:08 EST


Hi Andrew,

In unprivileged Xen domains, all that __ioremap() does is a
"return NULL", which causes dmi_iterate() to crash the kernel
at boot time.

This trivial check bails dmi_iterate() out of the loop when
it finds that the ioremap() returned a NULL pointer.

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>

--- linux/arch/i386/kernel/dmi_scan.c.orig 2005-01-12 14:55:14.000000000 -0500
+++ linux/arch/i386/kernel/dmi_scan.c 2005-01-12 16:06:27.000000000 -0500
@@ -105,6 +105,8 @@
char __iomem *p, *q;

for (p = q = ioremap(0xF0000, 0x10000); q < p + 0x10000; q += 16) {
+ if (p == NULL)
+ return -1;
memcpy_fromio(buf, q, 15);
if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/