diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-01-06 22:42:31 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 23:59:26 (GMT) |
commit | 6405141fb3d06ec4a50d054a113e3317cad054f9 (patch) | |
tree | c7b9f3b93b0c6016f1e20b03db3ea9e9bae1cedc | |
parent | 08cc6341cc04fad45c28995db796317b5b413045 (diff) | |
download | linux-fsl-qoriq-6405141fb3d06ec4a50d054a113e3317cad054f9.tar.xz |
gbefb: unsigned var->pixclock cannot be less than 0
unsigned var->pixclock cannot be less than 0
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/gbefb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index f89c3cc..fe5b519 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c @@ -912,6 +912,7 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { unsigned int line_length; struct gbe_timing_info timing; + int ret; /* Limit bpp to 8, 16, and 32 */ if (var->bits_per_pixel <= 8) @@ -930,8 +931,10 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var->grayscale = 0; /* No grayscale for now */ - if ((var->pixclock = compute_gbe_timing(var, &timing)) < 0) - return(-EINVAL); + ret = compute_gbe_timing(var, &timing); + var->pixclock = ret; + if (ret < 0) + return -EINVAL; /* Adjust virtual resolution, if necessary */ if (var->xres > var->xres_virtual || (!ywrap && !ypan)) |