diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-11-15 03:49:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-15 20:20:58 -0500 |
commit | 191c5f10275cfbb36802edadbdb10c73537327b4 (patch) | |
tree | 93e6f0d57cb1295fb7c461dbe5ecefafeb4ad15a /drivers/tty/cyclades.c | |
parent | d0f59141ca40159c9d142c0f62e9aea61f846539 (diff) |
TTY: call tty_port_destroy in the rest of drivers
After commit "TTY: move tty buffers to tty_port", the tty buffers are
not freed in some drivers. This is because tty_port_destructor is not
called whenever a tty_port is freed. This was an assumption I counted
with but was unfortunately untrue. So fix the drivers to fulfil this
assumption.
To be sure, the TTY buffers (and later some stuff) are gone along with
the tty_port, we have to call tty_port_destroy at tear-down places.
This is mostly where the structure containing a tty_port is freed.
This patch does exactly that -- put tty_port_destroy at those places.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r-- | drivers/tty/cyclades.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 0a6a0bc1b598..de25774b5ec6 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c | |||
@@ -3934,7 +3934,7 @@ err: | |||
3934 | static void __devexit cy_pci_remove(struct pci_dev *pdev) | 3934 | static void __devexit cy_pci_remove(struct pci_dev *pdev) |
3935 | { | 3935 | { |
3936 | struct cyclades_card *cinfo = pci_get_drvdata(pdev); | 3936 | struct cyclades_card *cinfo = pci_get_drvdata(pdev); |
3937 | unsigned int i; | 3937 | unsigned int i, channel; |
3938 | 3938 | ||
3939 | /* non-Z with old PLX */ | 3939 | /* non-Z with old PLX */ |
3940 | if (!cy_is_Z(cinfo) && (readb(cinfo->base_addr + CyPLX_VER) & 0x0f) == | 3940 | if (!cy_is_Z(cinfo) && (readb(cinfo->base_addr + CyPLX_VER) & 0x0f) == |
@@ -3960,9 +3960,11 @@ static void __devexit cy_pci_remove(struct pci_dev *pdev) | |||
3960 | pci_release_regions(pdev); | 3960 | pci_release_regions(pdev); |
3961 | 3961 | ||
3962 | cinfo->base_addr = NULL; | 3962 | cinfo->base_addr = NULL; |
3963 | for (i = cinfo->first_line; i < cinfo->first_line + | 3963 | for (channel = 0, i = cinfo->first_line; i < cinfo->first_line + |
3964 | cinfo->nports; i++) | 3964 | cinfo->nports; i++, channel++) { |
3965 | tty_unregister_device(cy_serial_driver, i); | 3965 | tty_unregister_device(cy_serial_driver, i); |
3966 | tty_port_destroy(&cinfo->ports[channel].port); | ||
3967 | } | ||
3966 | cinfo->nports = 0; | 3968 | cinfo->nports = 0; |
3967 | kfree(cinfo->ports); | 3969 | kfree(cinfo->ports); |
3968 | } | 3970 | } |