From 8d2ea6258123d7a92a1f6ec638a8cad4a0604c43 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 11 Jan 2006 20:48:09 +1100 Subject: [PATCH] drm: fixup drm bufs being just under the EOM 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 --- drivers/char/drm/drm_bufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 1845dd0628..1db12dcb68 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -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; -- 2.39.5