mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- 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
This commit is contained in:
parent
599bcd064c
commit
a6cb9d8e99
4 changed files with 18 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ agp_ali_attach(device_t dev)
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ agp_ali_attach(device_t dev)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue