diff options
Diffstat (limited to 'sys/dev/agp/agp_i810.c')
-rw-r--r-- | sys/dev/agp/agp_i810.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index 48cf17124c51..891bfff89da1 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -840,7 +840,7 @@ agp_i810_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_i810_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) { + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) { device_printf(dev, "failed: offset is 0x%08jx, shift is %d, entries is %d\n", (intmax_t)offset, AGP_PAGE_SHIFT, sc->gatt->ag_entries); return EINVAL; } @@ -862,7 +862,7 @@ agp_i810_unbind_page(device_t dev, vm_offset_t offset) { struct agp_i810_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; if ( sc->chiptype != CHIP_I810 ) { @@ -1016,7 +1016,7 @@ agp_i810_bind_memory(device_t dev, struct agp_memory *mem, vm_offset_t i; /* Do some sanity checks first. */ - if (offset < 0 || (offset & (AGP_PAGE_SIZE - 1)) != 0 || + if ((offset & (AGP_PAGE_SIZE - 1)) != 0 || offset + mem->am_size > AGP_GET_APERTURE(dev)) { device_printf(dev, "binding memory at bad offset %#x\n", (int)offset); |