summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_bufs.c2
-rw-r--r--linux-core/drm_vm.c2
-rw-r--r--linux/drm_bufs.h2
-rw-r--r--linux/drm_vm.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index 46cff57d..84ca1f47 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -186,7 +186,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head );
if ( _entry->map && _entry->map->type == map->type &&
_entry->map->offset == map->offset &&
- _entry->map->size == map->size ) {
+ _entry->map->size >= map->size ) {
DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
map = _entry->map;
DRM_DEBUG( "Found existing: offset = 0x%08lx, size = 0x%08lx, type = %d\n",
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 277aae0a..30b0e73e 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -569,7 +569,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
return -EPERM;
/* Check for valid size. */
- if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
+ if (map->size < vma->vm_end - vma->vm_start) return -EINVAL;
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
diff --git a/linux/drm_bufs.h b/linux/drm_bufs.h
index 46cff57d..84ca1f47 100644
--- a/linux/drm_bufs.h
+++ b/linux/drm_bufs.h
@@ -186,7 +186,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head );
if ( _entry->map && _entry->map->type == map->type &&
_entry->map->offset == map->offset &&
- _entry->map->size == map->size ) {
+ _entry->map->size >= map->size ) {
DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
map = _entry->map;
DRM_DEBUG( "Found existing: offset = 0x%08lx, size = 0x%08lx, type = %d\n",
diff --git a/linux/drm_vm.h b/linux/drm_vm.h
index 277aae0a..30b0e73e 100644
--- a/linux/drm_vm.h
+++ b/linux/drm_vm.h
@@ -569,7 +569,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
return -EPERM;
/* Check for valid size. */
- if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
+ if (map->size < vma->vm_end - vma->vm_start) return -EINVAL;
if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);