Felix's fix for map request smaller than permanent map size

main
Jon Smirl 2004-09-20 17:09:26 +00:00
parent 5654880eee
commit 59cc1d8256
4 changed files with 4 additions and 4 deletions

View File

@ -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",

View File

@ -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);

View File

@ -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",

View File

@ -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);