|
@@ -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 offset = vma->vm_pgoff << PAGE_SHIFT;
|
|
|
unsigned long page, pos;
|
|
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;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
pos = (unsigned long)info->fix.smem_start + offset;
|
|
pos = (unsigned long)info->fix.smem_start + offset;
|