From: Krzysztof Helt Date: Mon, 13 Apr 2009 21:39:55 +0000 (-0700) Subject: cirrusfb: do not allow unsupported pixel depth X-Git-Tag: firefly_0821_release~14502 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0efb2a03af7eddadb4d0db5f855b1614ba9b0a00;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, default: dev_dbg(info->device, "Unsupported bpp size: %d\n", var->bits_per_pixel); - assert(false); - /* should never occur */ - break; + return -EINVAL; } if (var->xres_virtual < var->xres)