diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2012-11-27 21:37:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-28 11:45:17 -0500 |
commit | a321846492f9ce3bab27f826e6579217fbc35732 (patch) | |
tree | c5a32733f5de4bb88c68ba32b188decba85ef004 | |
parent | eef6e7b286e6dcf39a9b8c1d31477ee489451a8a (diff) |
staging/fwserial: Destruct embedded tty_port on teardown
For TTY drivers that manage the port lifetime, the tty_port should
to be specifically destructed when the port lifetime ends. Now that
a method has been added to do this, use it.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
-rw-r--r-- | drivers/staging/fwserial/fwserial.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 5d4d64a3ea81..99a2d2dbd322 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c | |||
@@ -955,6 +955,7 @@ static void fwserial_destroy(struct kref *kref) | |||
955 | for (j = 0; j < num_ports; ++j) { | 955 | for (j = 0; j < num_ports; ++j) { |
956 | fw_core_remove_address_handler(&ports[j]->rx_handler); | 956 | fw_core_remove_address_handler(&ports[j]->rx_handler); |
957 | dma_fifo_free(&ports[j]->tx_fifo); | 957 | dma_fifo_free(&ports[j]->tx_fifo); |
958 | tty_port_destroy(&ports[j]->port); | ||
958 | kfree(ports[j]); | 959 | kfree(ports[j]); |
959 | } | 960 | } |
960 | kfree(serial); | 961 | kfree(serial); |
@@ -2369,8 +2370,10 @@ unregister_ttys: | |||
2369 | return err; | 2370 | return err; |
2370 | 2371 | ||
2371 | free_ports: | 2372 | free_ports: |
2372 | for (--i; i >= 0; --i) | 2373 | for (--i; i >= 0; --i) { |
2374 | tty_port_destroy(&serial->ports[i]->port); | ||
2373 | kfree(serial->ports[i]); | 2375 | kfree(serial->ports[i]); |
2376 | } | ||
2374 | kfree(serial); | 2377 | kfree(serial); |
2375 | return err; | 2378 | return err; |
2376 | } | 2379 | } |