summaryrefslogtreecommitdiff
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-06-16 06:58:27 +0300
committerDave Airlie <airlied@redhat.com>2017-06-16 06:58:27 +0300
commit925344ccc91d7a7fd84cab2dece1c34bbd86fd8c (patch)
treebd4110dc5a3b70a5674b9d6d5340cc1889f5d6e8 /drivers/char/mem.c
parenta6821698918a579e7219d706092e83f367f01ba2 (diff)
parent32c1431eea4881a6b17bd7c639315010aeefa452 (diff)
downloadlinux-925344ccc91d7a7fd84cab2dece1c34bbd86fd8c.tar.xz
BackMerge tag 'v4.12-rc5' into drm-next
Linux 4.12-rc5 for nouveau fixes
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 6e0cbe092220..593a8818aca9 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -343,7 +343,7 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;
/* It's illegal to wrap around the end of the physical address space. */
- if (offset + (phys_addr_t)size < offset)
+ if (offset + (phys_addr_t)size - 1 < offset)
return -EINVAL;
if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))