X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Fmem.c;h=d78365603952d5b364d1c858bc097933972e4a5a;hb=5a05d9046553c6d85fca860f0b3f76f0c735d0cc;hp=1c8cfa67f7e1f05693db3827b8e21be57699be2d;hpb=a64f41f9bf410e24fe687116ba251b5c5d243830;p=pandora-kernel.git diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 1c8cfa67f7e1..d78365603952 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -325,7 +325,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))