Skip to content

Commit 4e47382

Browse files
martin-kaiserhdeller
authored andcommitted
fbdev: imxfb: warn about invalid left/right margin
Warn about invalid var->left_margin or var->right_margin. Their values are read from the device tree. We store var->left_margin-3 and var->right_margin-1 in register fields. These fields should be >= 0. Fixes: 7e8549b ("imxfb: Fix margin settings") Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 06c2afb commit 4e47382

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/video/fbdev/imxfb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
613613
if (var->hsync_len < 1 || var->hsync_len > 64)
614614
printk(KERN_ERR "%s: invalid hsync_len %d\n",
615615
info->fix.id, var->hsync_len);
616-
if (var->left_margin > 255)
616+
if (var->left_margin < 3 || var->left_margin > 255)
617617
printk(KERN_ERR "%s: invalid left_margin %d\n",
618618
info->fix.id, var->left_margin);
619-
if (var->right_margin > 255)
619+
if (var->right_margin < 1 || var->right_margin > 255)
620620
printk(KERN_ERR "%s: invalid right_margin %d\n",
621621
info->fix.id, var->right_margin);
622622
if (var->yres < 1 || var->yres > ymax_mask)

0 commit comments

Comments
 (0)