cirrusfb: do not allow unsupported pixel depth
authorKrzysztof Helt <krzysztof.h1@wp.pl>
Mon, 13 Apr 2009 21:39:55 +0000 (14:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Apr 2009 22:04:30 +0000 (15:04 -0700)
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>
drivers/video/cirrusfb.c

index d42e385f091c7658418d844f7cc77db306bd0a93..4c2bf923418c34bea4254318faeafb2d84190255 100644 (file)
@@ -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)