aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/ioc4_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/ioc4_serial.c')
-rw-r--r--drivers/tty/serial/ioc4_serial.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index e5c42fef69d2..3be051abb2a2 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1082,7 +1082,7 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd)
if (!port) {
printk(KERN_WARNING
"IOC4 serial memory not available for port\n");
- return -ENOMEM;
+ goto free;
}
spin_lock_init(&port->ip_lock);
@@ -1190,6 +1190,11 @@ static int inline ioc4_attach_local(struct ioc4_driver_data *idd)
handle_dma_error_intr, port);
}
return 0;
+
+free:
+ while (port_number)
+ kfree(ports[--port_number]);
+ return -ENOMEM;
}
/**