From: Geert Uytterhoeven fbcon_prepare_logo(): Avoid vertical overflow when making space for the logo Signed-off-by: Geert Uytterhoeven Signed-off-by: Geoff Levand Acked-By: James Simmons Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton --- drivers/video/console/fbcon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff -puN drivers/video/console/fbcon.c~fbdev-avoid-vertical-overflow-when-making-space-for-the-logo drivers/video/console/fbcon.c --- a/drivers/video/console/fbcon.c~fbdev-avoid-vertical-overflow-when-making-space-for-the-logo +++ a/drivers/video/console/fbcon.c @@ -618,8 +618,13 @@ static void fbcon_prepare_logo(struct vc r -= cols; } if (!save) { - vc->vc_y += logo_lines; - vc->vc_pos += logo_lines * vc->vc_size_row; + int lines; + if (vc->vc_y + logo_lines >= rows) + lines = rows - vc->vc_y - 1; + else + lines = logo_lines; + vc->vc_y += lines; + vc->vc_pos += lines * vc->vc_size_row; } } scr_memsetw((unsigned short *) vc->vc_origin, _