summaryrefslogtreecommitdiff
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2017-06-12 23:18:55 +0530
committerSumit Semwal <sumit.semwal@linaro.org>2017-06-12 23:18:55 +0530
commit8cee66e33cf2e740a18c23a785694c7f83e24ee3 (patch)
treef9ac8294378b518b5bb214ccd955f3fbf0763524 /drivers/char/mem.c
parent611a390fbe4eb5e1ec2a7d535343c676c79fe292 (diff)
parent01f99201744662692ca6888ee9aeee36776f47fb (diff)
Merge remote-tracking branch 'stable-rc/linux-4.4.y' into 4.4.72-rc-hikey4.4-72-rc-hikey-201706124.4.y-rc-hikey
Resolved conficts: Makefile fs/xfs/xfs_xattr.c net/bridge/br_stp_if.c net/ipv6/ip6_offload.c Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
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 0975d23031ea..2898d19fadf5 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -346,7 +346,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))