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>

next in thread | raw e-mail | index | archive | help
--MP_Q8n0WYAB9TK4b.xc9kYkbou
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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
--MP_Q8n0WYAB9TK4b.xc9kYkbou
Content-Type: text/x-patch; name=freebsd-ppc-cpu.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=freebsd-ppc-cpu.diff

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;
 	}

--MP_Q8n0WYAB9TK4b.xc9kYkbou--



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