diff options
author | anholt <anholt@FreeBSD.org> | 2003-11-11 21:49:18 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2003-11-11 21:49:18 +0000 |
commit | a3bf20009f70eba5aa2a79bfd38c9363d624f530 (patch) | |
tree | 6923eb476dc98a422a64974b7a37b8308fda7fc7 /sys/pci/agp.c | |
parent | 9cd493ccafa4a5de0ccf5fa52c5805372f51cd37 (diff) | |
download | FreeBSD-src-a3bf20009f70eba5aa2a79bfd38c9363d624f530.zip FreeBSD-src-a3bf20009f70eba5aa2a79bfd38c9363d624f530.tar.gz |
- Disable AGP on ALI chipsets if aperture size is 0.
- Fail in agp_alloc_gatt if the aperture size is 0 instead of panicing in
contigmalloc.
Reported by: Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
Reviewed by: jhb
MFC after: 1 week
Diffstat (limited to 'sys/pci/agp.c')
-rw-r--r-- | sys/pci/agp.c | 5 |
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; |