Skip to content

Commit

Permalink
acornfb: Dont BUG() on invalid pan parameters
Browse files Browse the repository at this point in the history
The driver currently BUG()s if the pan parameters passed directly from
userspace are invalid. Return -EINVAL instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Laurent Pinchart authored and Paul Mundt committed Jun 15, 2011
1 parent c42a3d5 commit a1bb701
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/acornfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,8 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
if (!(var->vmode & FB_VMODE_YWRAP))
y_bottom += var->yres;

BUG_ON(y_bottom > var->yres_virtual);
if (y_bottom > var->yres_virtual)
return -EINVAL;

acornfb_update_dma(info, var);

Expand Down

0 comments on commit a1bb701

Please sign in to comment.