From: Geert Uytterhoeven Date: Tue, 8 May 2007 07:37:53 +0000 (-0700) Subject: fbdev: avoid vertical overflow when making space for the logo X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=250038f5a7207796fb54aff3dc686d664659cf0c;p=openwrt%2Fstaging%2Fblogic.git fbdev: avoid vertical overflow when making space for the logo 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 Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 0429fd2cece0..bd131d472e24 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -618,8 +618,13 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, 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,