Skip to content

Commit

Permalink
[PATCH] vgacon: Fix sanity checking in vgacon_resize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Sep 15, 2005
1 parent 7b6a186 commit 6d36ba6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/console/vgacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,9 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
static int vgacon_resize(struct vc_data *c, unsigned int width,
unsigned int height)
{
if (width % 2 || width > ORIG_VIDEO_COLS || height > ORIG_VIDEO_LINES)
if (width % 2 || width > ORIG_VIDEO_COLS ||
height > (ORIG_VIDEO_LINES * vga_default_font_height)/
c->vc_font.height)
return -EINVAL;

if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */
Expand Down

0 comments on commit 6d36ba6

Please sign in to comment.