diff mbox

drm/gma500: simplify a condition in psbfb_mmap()

Message ID 20180323114429.GE28518@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter March 23, 2018, 11:44 a.m. UTC
Since we enforce that "vma->vm_pgoff" has to be zero it means we don't
need an additional cap on the upper bound.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index cb0a2ae916e0..a6732bffb2e2 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -166,9 +166,7 @@  static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 	struct psb_fbdev *fbdev = info->par;
 	struct psb_framebuffer *psbfb = &fbdev->pfb;
 
-	if (vma->vm_pgoff != 0)
-		return -EINVAL;
-	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
+	if (vma->vm_pgoff)
 		return -EINVAL;
 
 	if (!psbfb->addr_space)