Commit f933cb6b authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbcon: Fix endian bug in fbcon_putc (console mouse problem)

The typecast (const unsigned short *) &c in fbcon_putc is not correct for
big-endian machines.  This problem manifests as a black cursor that can be
used to erase the console screen contents.  The correct fix is to use
scr_writew instead.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9fb56675
...@@ -1012,7 +1012,10 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, ...@@ -1012,7 +1012,10 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
{ {
fbcon_putcs(vc, (const unsigned short *) &c, 1, ypos, xpos); unsigned short chr;
scr_writew(c, &chr);
fbcon_putcs(vc, &chr, 1, ypos, xpos);
} }
static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment