diff options
-rw-r--r-- | drivers/char/mxser_new.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 9449fba80faa..937c101db905 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c | |||
@@ -1168,21 +1168,18 @@ static void mxser_flush_buffer(struct tty_struct *tty) | |||
1168 | static int mxser_get_serial_info(struct mxser_port *info, | 1168 | static int mxser_get_serial_info(struct mxser_port *info, |
1169 | struct serial_struct __user *retinfo) | 1169 | struct serial_struct __user *retinfo) |
1170 | { | 1170 | { |
1171 | struct serial_struct tmp; | 1171 | struct serial_struct tmp = { |
1172 | 1172 | .type = info->type, | |
1173 | if (!retinfo) | 1173 | .line = info->tty->index, |
1174 | return -EFAULT; | 1174 | .port = info->ioaddr, |
1175 | memset(&tmp, 0, sizeof(tmp)); | 1175 | .irq = info->board->irq, |
1176 | tmp.type = info->type; | 1176 | .flags = info->flags, |
1177 | tmp.line = info->tty->index; | 1177 | .baud_base = info->baud_base, |
1178 | tmp.port = info->ioaddr; | 1178 | .close_delay = info->close_delay, |
1179 | tmp.irq = info->board->irq; | 1179 | .closing_wait = info->closing_wait, |
1180 | tmp.flags = info->flags; | 1180 | .custom_divisor = info->custom_divisor, |
1181 | tmp.baud_base = info->baud_base; | 1181 | .hub6 = 0 |
1182 | tmp.close_delay = info->close_delay; | 1182 | }; |
1183 | tmp.closing_wait = info->closing_wait; | ||
1184 | tmp.custom_divisor = info->custom_divisor; | ||
1185 | tmp.hub6 = 0; | ||
1186 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) | 1183 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) |
1187 | return -EFAULT; | 1184 | return -EFAULT; |
1188 | return 0; | 1185 | return 0; |