diff options
Diffstat (limited to 'drivers/tty/moxa.c')
-rw-r--r-- | drivers/tty/moxa.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 9b57aae139f..d628176fb6d 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) return 0; err_free: + for (i = 0; i < MAX_PORTS_PER_BOARD; i++) + tty_port_destroy(&brd->ports[i].port); kfree(brd->ports); err: return ret; @@ -919,6 +921,8 @@ static void moxa_board_deinit(struct moxa_board_conf *brd) tty_kref_put(tty); } } + for (a = 0; a < MAX_PORTS_PER_BOARD; a++) + tty_port_destroy(&brd->ports[a].port); while (1) { opened = 0; for (a = 0; a < brd->numPorts; a++) |