aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r--drivers/uio/uio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 68a496557788..03efb065455f 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -708,7 +708,8 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
708 return -EINVAL; 708 return -EINVAL;
709 709
710 requested_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 710 requested_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
711 actual_pages = (idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT; 711 actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK)
712 + idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT;
712 if (requested_pages > actual_pages) 713 if (requested_pages > actual_pages)
713 return -EINVAL; 714 return -EINVAL;
714 715