aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tty_io.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index a37e6330db8a..fde69e589ca7 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2033,11 +2033,9 @@ static int init_dev(struct tty_driver *driver, int idx,
2033 } 2033 }
2034 2034
2035 if (!*ltp_loc) { 2035 if (!*ltp_loc) {
2036 ltp = (struct ktermios *) kmalloc(sizeof(struct ktermios), 2036 ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL);
2037 GFP_KERNEL);
2038 if (!ltp) 2037 if (!ltp)
2039 goto free_mem_out; 2038 goto free_mem_out;
2040 memset(ltp, 0, sizeof(struct ktermios));
2041 } 2039 }
2042 2040
2043 if (driver->type == TTY_DRIVER_TYPE_PTY) { 2041 if (driver->type == TTY_DRIVER_TYPE_PTY) {
@@ -2066,11 +2064,9 @@ static int init_dev(struct tty_driver *driver, int idx,
2066 } 2064 }
2067 2065
2068 if (!*o_ltp_loc) { 2066 if (!*o_ltp_loc) {
2069 o_ltp = (struct ktermios *) 2067 o_ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL);
2070 kmalloc(sizeof(struct ktermios), GFP_KERNEL);
2071 if (!o_ltp) 2068 if (!o_ltp)
2072 goto free_mem_out; 2069 goto free_mem_out;
2073 memset(o_ltp, 0, sizeof(struct ktermios));
2074 } 2070 }
2075 2071
2076 /* 2072 /*
@@ -3755,9 +3751,8 @@ struct tty_driver *alloc_tty_driver(int lines)
3755{ 3751{
3756 struct tty_driver *driver; 3752 struct tty_driver *driver;
3757 3753
3758 driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL); 3754 driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL);
3759 if (driver) { 3755 if (driver) {
3760 memset(driver, 0, sizeof(struct tty_driver));
3761 driver->magic = TTY_DRIVER_MAGIC; 3756 driver->magic = TTY_DRIVER_MAGIC;
3762 driver->num = lines; 3757 driver->num = lines;
3763 /* later we'll move allocation of tables here */ 3758 /* later we'll move allocation of tables here */