s390/3270: fix allocation of tty3270_screen structure
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 18 Dec 2013 13:36:18 +0000 (14:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2014 20:25:15 +0000 (12:25 -0800)
commit6f3241a8ac9644c17ce7dc053d425f4bae7b0fb7
tree895c3b777cbc38caa12f10ac1fee802f167d0e37
parent6a220f25a6890af22ae55c680531169707dbee37
s390/3270: fix allocation of tty3270_screen structure

commit 36d9f4d3b68c7035ead3850dc85f310a579ed0eb upstream.

The tty3270_alloc_screen function is called from tty3270_install with
swapped arguments, the number of columns instead of rows and vice versa.
The number of rows is typically smaller than the number of columns which
makes the screen array too big but the individual cell arrays for the
lines too small. Creating lines longer than the number of rows will
clobber the memory after the end of the cell array.
The fix is simple, call tty3270_alloc_screen with the correct argument
order.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/char/tty3270.c