Commit 8d2ea625 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

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: default avatarDave Airlie <airlied@linux.ie>
parent f8e0f290
...@@ -154,7 +154,7 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset, ...@@ -154,7 +154,7 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
case _DRM_REGISTERS: case _DRM_REGISTERS:
case _DRM_FRAME_BUFFER: case _DRM_FRAME_BUFFER:
#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) #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)) { map->offset < virt_to_phys(high_memory)) {
drm_free(map, sizeof(*map), DRM_MEM_MAPS); drm_free(map, sizeof(*map), DRM_MEM_MAPS);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment