mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
fbdev: imxfb: warn about invalid left/right margin
[ Upstream commit4e47382fbc] 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:7e8549bcee("imxfb: Fix margin settings") Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5d19146753
commit
29fb046ec0
@@ -602,10 +602,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
|
||||
if (var->hsync_len < 1 || var->hsync_len > 64)
|
||||
printk(KERN_ERR "%s: invalid hsync_len %d\n",
|
||||
info->fix.id, var->hsync_len);
|
||||
if (var->left_margin > 255)
|
||||
if (var->left_margin < 3 || var->left_margin > 255)
|
||||
printk(KERN_ERR "%s: invalid left_margin %d\n",
|
||||
info->fix.id, var->left_margin);
|
||||
if (var->right_margin > 255)
|
||||
if (var->right_margin < 1 || var->right_margin > 255)
|
||||
printk(KERN_ERR "%s: invalid right_margin %d\n",
|
||||
info->fix.id, var->right_margin);
|
||||
if (var->yres < 1 || var->yres > ymax_mask)
|
||||
|
||||
Reference in New Issue
Block a user