]> err.no Git - linux-2.6/commitdiff
drm: fixup drm bufs being just under the EOM
authorDave Airlie <airlied@starflyer.(none)>
Wed, 11 Jan 2006 09:48:09 +0000 (20:48 +1100)
committerDave Airlie <airlied@linux.ie>
Wed, 11 Jan 2006 09:48:09 +0000 (20:48 +1100)
If the mapping was just under the end of memory it would fail.
Lets DRM start on my PCI card.

Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_bufs.c

index 1845dd06281645870e5b3f2645eea03b072a44f7..1db12dcb6802f8e52b7622a415d6072d6c4f00f6 100644 (file)
@@ -154,7 +154,7 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
        case _DRM_REGISTERS:
        case _DRM_FRAME_BUFFER:
 #if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__)
-               if (map->offset + map->size < map->offset ||
+               if (map->offset + (map->size-1) < map->offset ||
                    map->offset < virt_to_phys(high_memory)) {
                        drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                        return -EINVAL;