linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video/imxfb: add more range-checking for right and left margin values
@ 2013-12-24  9:43 Paul Fertser
  0 siblings, 0 replies; only message in thread
From: Paul Fertser @ 2013-12-24  9:43 UTC (permalink / raw)
  To: linux-fbdev

A user not familiar with this LCD controller might assume it's
possible to use arbitrary short horizontal margins if the display
allows that. Make it clear it's not.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
 drivers/video/imxfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 44ee678..103e175 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -671,10 +671,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 > 255 || var->left_margin < 3)
 		printk(KERN_ERR "%s: invalid left_margin %d\n",
 			info->fix.id, var->left_margin);
-	if (var->right_margin > 255)
+	if (var->right_margin > 255 || var->right_margin < 1)
 		printk(KERN_ERR "%s: invalid right_margin %d\n",
 			info->fix.id, var->right_margin);
 	if (var->yres < 1 || var->yres > ymax_mask)
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-24  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-24  9:43 [PATCH] video/imxfb: add more range-checking for right and left margin values Paul Fertser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).