Skip to content

Commit

Permalink
s390/3270: fix allocation of tty3270_screen structure
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Martin Schwidefsky committed Dec 18, 2013
1 parent d80512f commit 36d9f4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/char/tty3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
return rc;
}

tp->screen = tty3270_alloc_screen(tp->view.cols, tp->view.rows);
tp->screen = tty3270_alloc_screen(tp->view.rows, tp->view.cols);
if (IS_ERR(tp->screen)) {
rc = PTR_ERR(tp->screen);
raw3270_put_view(&tp->view);
Expand Down

0 comments on commit 36d9f4d

Please sign in to comment.