aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tty3270.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/tty3270.c')
-rw-r--r--drivers/s390/char/tty3270.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 4b9069370388..9a141776873f 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -691,10 +691,9 @@ tty3270_alloc_view(void)
691 struct tty3270 *tp; 691 struct tty3270 *tp;
692 int pages; 692 int pages;
693 693
694 tp = kmalloc(sizeof(struct tty3270),GFP_KERNEL); 694 tp = kzalloc(sizeof(struct tty3270), GFP_KERNEL);
695 if (!tp) 695 if (!tp)
696 goto out_err; 696 goto out_err;
697 memset(tp, 0, sizeof(struct tty3270));
698 tp->freemem_pages = 697 tp->freemem_pages =
699 kmalloc(sizeof(void *) * TTY3270_STRING_PAGES, GFP_KERNEL); 698 kmalloc(sizeof(void *) * TTY3270_STRING_PAGES, GFP_KERNEL);
700 if (!tp->freemem_pages) 699 if (!tp->freemem_pages)
@@ -767,16 +766,14 @@ tty3270_alloc_screen(struct tty3270 *tp)
767 int lines; 766 int lines;
768 767
769 size = sizeof(struct tty3270_line) * (tp->view.rows - 2); 768 size = sizeof(struct tty3270_line) * (tp->view.rows - 2);
770 tp->screen = kmalloc(size, GFP_KERNEL); 769 tp->screen = kzalloc(size, GFP_KERNEL);
771 if (!tp->screen) 770 if (!tp->screen)
772 goto out_err; 771 goto out_err;
773 memset(tp->screen, 0, size);
774 for (lines = 0; lines < tp->view.rows - 2; lines++) { 772 for (lines = 0; lines < tp->view.rows - 2; lines++) {
775 size = sizeof(struct tty3270_cell) * tp->view.cols; 773 size = sizeof(struct tty3270_cell) * tp->view.cols;
776 tp->screen[lines].cells = kmalloc(size, GFP_KERNEL); 774 tp->screen[lines].cells = kzalloc(size, GFP_KERNEL);
777 if (!tp->screen[lines].cells) 775 if (!tp->screen[lines].cells)
778 goto out_screen; 776 goto out_screen;
779 memset(tp->screen[lines].cells, 0, size);
780 } 777 }
781 return 0; 778 return 0;
782out_screen: 779out_screen: