|
@@ -677,7 +677,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
|
|
|
if (mi < 0)
|
|
if (mi < 0)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
- requested_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
|
|
|
|
|
|
|
+ requested_pages = vma_pages(vma);
|
|
|
actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK)
|
|
actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK)
|
|
|
+ idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT;
|
|
+ idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT;
|
|
|
if (requested_pages > actual_pages)
|
|
if (requested_pages > actual_pages)
|