Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2007 22:11:07 +1300
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        freebsd-ppc@freebsd.org
Subject:   Bug in cpu.c
Message-ID:  <20070218221107.2a453e4a@hermies.int.fubar.geek.nz>

index | next in thread | raw e-mail

[-- Attachment #1 --]
When booting on an unknown cpu the loop in sys/powerpc/powerpc/cpu.c to
find the model will run past the end of the list of possible models.
The attached patch fixes this.

Andrew
[-- Attachment #2 --]
Index: sys/powerpc/powerpc/cpu.c
===================================================================
RCS file: /cvsroot/src/sys/powerpc/powerpc/cpu.c,v
retrieving revision 1.7
diff -u -r1.7 cpu.c
--- sys/powerpc/powerpc/cpu.c	4 Feb 2005 01:59:48 -0000	1.7
+++ sys/powerpc/powerpc/cpu.c	18 Feb 2007 04:43:54 -0000
@@ -126,7 +126,7 @@
 		min = (pvr >>  0) & 0xf;
 	}
 
-	for (cp = models; cp->name[0] != '\0'; cp++) {
+	for (cp = models; cp->version != 0; cp++) {
 		if (cp->version == vers)
 			break;
 	}
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070218221107.2a453e4a>