aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/moxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/moxa.c')
-rw-r--r--drivers/tty/moxa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 9b57aae139f6..d628176fb6d8 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -895,6 +895,8 @@ static int moxa_init_board(struct moxa_board_conf *brd, struct device *dev)
895 895
896 return 0; 896 return 0;
897err_free: 897err_free:
898 for (i = 0; i < MAX_PORTS_PER_BOARD; i++)
899 tty_port_destroy(&brd->ports[i].port);
898 kfree(brd->ports); 900 kfree(brd->ports);
899err: 901err:
900 return ret; 902 return ret;
@@ -919,6 +921,8 @@ static void moxa_board_deinit(struct moxa_board_conf *brd)
919 tty_kref_put(tty); 921 tty_kref_put(tty);
920 } 922 }
921 } 923 }
924 for (a = 0; a < MAX_PORTS_PER_BOARD; a++)
925 tty_port_destroy(&brd->ports[a].port);
922 while (1) { 926 while (1) {
923 opened = 0; 927 opened = 0;
924 for (a = 0; a < brd->numPorts; a++) 928 for (a = 0; a < brd->numPorts; a++)