aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mos7840.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r--drivers/usb/serial/mos7840.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 021be39fe16e..02c89e10b2cf 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2413,11 +2413,12 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2413 } 2413 }
2414 2414
2415 mos7840_port = mos7840_get_port_private(port); 2415 mos7840_port = mos7840_get_port_private(port);
2416 tty = mos7840_port->port->tty;
2417 2416
2418 if (mos7840_port == NULL) 2417 if (mos7840_port == NULL)
2419 return -1; 2418 return -1;
2420 2419
2420 tty = mos7840_port->port->tty;
2421
2421 dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd); 2422 dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd);
2422 2423
2423 switch (cmd) { 2424 switch (cmd) {
@@ -2595,12 +2596,11 @@ static int mos7840_startup(struct usb_serial *serial)
2595 2596
2596 /* set up port private structures */ 2597 /* set up port private structures */
2597 for (i = 0; i < serial->num_ports; ++i) { 2598 for (i = 0; i < serial->num_ports; ++i) {
2598 mos7840_port = kmalloc(sizeof(struct moschip_port), GFP_KERNEL); 2599 mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
2599 if (mos7840_port == NULL) { 2600 if (mos7840_port == NULL) {
2600 err("%s - Out of memory", __FUNCTION__); 2601 err("%s - Out of memory", __FUNCTION__);
2601 return -ENOMEM; 2602 return -ENOMEM;
2602 } 2603 }
2603 memset(mos7840_port, 0, sizeof(struct moschip_port));
2604 2604
2605 /* Initialize all port interrupt end point to port 0 int endpoint * 2605 /* Initialize all port interrupt end point to port 0 int endpoint *
2606 * Our device has only one interrupt end point comman to all port */ 2606 * Our device has only one interrupt end point comman to all port */