summaryrefslogtreecommitdiffstats
path: root/sys/pci/agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/agp.c')
-rw-r--r--sys/pci/agp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/pci/agp.c b/sys/pci/agp.c
index 7bf49b2..e664459 100644
--- a/sys/pci/agp.c
+++ b/sys/pci/agp.c
@@ -175,6 +175,11 @@ agp_alloc_gatt(device_t dev)
"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;
OpenPOWER on IntegriCloud