[PATCH] fbcon: fix obvious bug in fbcon logo rotation code
authorJasper Spaans <jasper@vs19.net>
Thu, 24 Nov 2005 15:53:36 +0000 (16:53 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 25 Nov 2005 02:40:34 +0000 (18:40 -0800)
This code fixes a tiny problem with the recent fbcon rotation changes:
fb_prepare_logo doesn't check the return value of fb_find_logo and that
causes a crash for my while booting.

Obvious & working & tested fix is here.

Signed-off-by: Jasper Spaans <jasper@vs19.net>
Acked-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/video/fbmem.c

index 9f180096c896f6330678adc74c78316aef458b0e..6240aedb41543f6870f1df4f3ddfaec8344a7f7a 100644 (file)
@@ -452,13 +452,17 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 
        /* Return if no suitable logo was found */
        fb_logo.logo = fb_find_logo(depth);
+
+       if (!fb_logo.logo) {
+               return 0;
+       }
        
        if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD)
                yres = info->var.yres;
        else
                yres = info->var.xres;
 
-       if (fb_logo.logo && fb_logo.logo->height > yres) {
+       if (fb_logo.logo->height > yres) {
                fb_logo.logo = NULL;
                return 0;
        }