PERFORCE change 42052 for review

John Baldwin jhb at FreeBSD.org
Tue Nov 11 14:10:36 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=42052

Change 42052 by jhb at jhb_blue on 2003/11/11 14:09:38

	IFC @42051.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_turnstile.c#2 delete
.. //depot/projects/smpng/sys/pci/agp.c#16 integrate
.. //depot/projects/smpng/sys/pci/agp_ali.c#7 integrate

Differences ...

==== //depot/projects/smpng/sys/pci/agp.c#16 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.33 2003/10/23 18:08:56 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.34 2003/11/11 21:49:18 anholt Exp $");
 
 #include "opt_bus.h"
 
@@ -175,6 +175,11 @@
 			      "allocating GATT for aperture of size %dM\n",
 			      apsize / (1024*1024));
 
+	if (entries == 0) {
+		device_printf(dev, "bad aperture size\n");
+		return NULL;
+	}
+
 	gatt = malloc(sizeof(struct agp_gatt), M_AGP, M_NOWAIT);
 	if (!gatt)
 		return 0;

==== //depot/projects/smpng/sys/pci/agp_ali.c#7 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_ali.c,v 1.8 2003/08/22 07:13:20 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_ali.c,v 1.9 2003/11/11 21:49:18 anholt Exp $");
 
 #include "opt_bus.h"
 
@@ -102,6 +102,10 @@
 		return error;
 
 	sc->initial_aperture = AGP_GET_APERTURE(dev);
+	if (sc->initial_aperture == 0) {
+		device_printf(dev, "bad initial aperture size, disabling\n");
+		return ENXIO;
+	}
 
 	for (;;) {
 		gatt = agp_alloc_gatt(dev);


More information about the p4-projects mailing list