aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-09-15 09:14:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-15 11:24:09 -0400
commit6d36ba629e0ef47a03d3703ee1d38143c25532a8 (patch)
tree8b49ebe957891c439dd0b596eb7eb78cc2ae0765 /drivers/video
parent7b6a186d65589901a73d460070504a5e02703c45 (diff)
[PATCH] vgacon: Fix sanity checking in vgacon_resize
Reported by: walt <wa1ter@myrealbox.com> "I routinely switch the console font during bootup to 8x8 so I can get 50 lines per screen. Until 09 Sept, just changing to the small font automatically gave me all 50 lines -- but now I'm only getting 25 lines even with the small font. The bottom half of the screen displays the text that already scrolled off the top." This bug is due to an erroneous check in the recently added hook, vgacon_resize(). It checks the new height against the original number of rows of the console. Because the original number of rows depends on both the scanline and the font height, check it instead against the scanline/fontheight. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console/vgacon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 0705cd741411..6ef6f7760e47 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1020,7 +1020,9 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
1020static int vgacon_resize(struct vc_data *c, unsigned int width, 1020static int vgacon_resize(struct vc_data *c, unsigned int width,
1021 unsigned int height) 1021 unsigned int height)
1022{ 1022{
1023 if (width % 2 || width > ORIG_VIDEO_COLS || height > ORIG_VIDEO_LINES) 1023 if (width % 2 || width > ORIG_VIDEO_COLS ||
1024 height > (ORIG_VIDEO_LINES * vga_default_font_height)/
1025 c->vc_font.height)
1024 return -EINVAL; 1026 return -EINVAL;
1025 1027
1026 if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */ 1028 if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */