aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-04-13 17:39:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-13 18:04:30 -0400
commit0efb2a03af7eddadb4d0db5f855b1614ba9b0a00 (patch)
tree6cadf4f50fbdee402182c793c1b2239b4ac4a2c9
parent697f619fc87aa9bf5b6c8c756f7ea54e950d5cd5 (diff)
cirrusfb: do not allow unsupported pixel depth
Do not allow modes with unsupported pixel depth. Otherwise, one can hang a computer by setting incorrect value with fbset command. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/cirrusfb.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index d42e385f091c..4c2bf923418c 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -567,9 +567,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
567 default: 567 default:
568 dev_dbg(info->device, 568 dev_dbg(info->device,
569 "Unsupported bpp size: %d\n", var->bits_per_pixel); 569 "Unsupported bpp size: %d\n", var->bits_per_pixel);
570 assert(false); 570 return -EINVAL;
571 /* should never occur */
572 break;
573 } 571 }
574 572
575 if (var->xres_virtual < var->xres) 573 if (var->xres_virtual < var->xres)