From: Jasper Spaans Date: Thu, 24 Nov 2005 15:53:36 +0000 (+0100) Subject: [PATCH] fbcon: fix obvious bug in fbcon logo rotation code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d9885a8ce45cd9b7d36517ee823a480eaf95c02;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] fbcon: fix obvious bug in fbcon logo rotation code 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 Acked-by: Antonino Daplas Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 9f180096c896..6240aedb4154 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -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; }