Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362954
b: refs/heads/master
c: 04f8afb
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Apr 26, 2013
1 parent 3835f38 commit 49aeee6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11bd5933abe033fb7a3a0d1f1bd2cb4b6df8143f
refs/heads/master: 04f8afbec37f63fafce16e454a7848426aa36202
4 changes: 3 additions & 1 deletion trunk/drivers/video/gbefb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,9 @@ static int gbefb_mmap(struct fb_info *info,
/* check range */
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
if (offset + size > gbe_mem_size)
if (size > gbe_mem_size)
return -EINVAL;
if (offset > gbe_mem_size - size)
return -EINVAL;

/* remap using the fastest write-through mode on architecture */
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/video/smscufx.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,11 @@ static int ufx_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;

if (offset + size > info->fix.smem_len)
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
if (size > info->fix.smem_len)
return -EINVAL;
if (offset > info->fix.smem_len - size)
return -EINVAL;

pos = (unsigned long)info->fix.smem_start + offset;
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/video/udlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;

if (offset + size > info->fix.smem_len)
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
if (size > info->fix.smem_len)
return -EINVAL;
if (offset > info->fix.smem_len - size)
return -EINVAL;

pos = (unsigned long)info->fix.smem_start + offset;
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/video/vfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,12 @@ static int vfb_mmap(struct fb_info *info,
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;

if (offset + size > info->fix.smem_len) {
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
if (size > info->fix.smem_len)
return -EINVAL;
if (offset > info->fix.smem_len - size)
return -EINVAL;
}

pos = (unsigned long)info->fix.smem_start + offset;

Expand Down

0 comments on commit 49aeee6

Please sign in to comment.