aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-11-15 03:49:56 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 20:20:58 -0500
commit191c5f10275cfbb36802edadbdb10c73537327b4 (patch)
tree93e6f0d57cb1295fb7c461dbe5ecefafeb4ad15a /arch/m68k
parentd0f59141ca40159c9d142c0f62e9aea61f846539 (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 'arch/m68k')
-rw-r--r--arch/m68k/emu/nfcon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/m68k/emu/nfcon.c b/arch/m68k/emu/nfcon.c
index 16d170f53bfd..6685bf45c2c3 100644
--- a/arch/m68k/emu/nfcon.c
+++ b/arch/m68k/emu/nfcon.c
@@ -120,8 +120,6 @@ static int __init nfcon_init(void)
120{ 120{
121 int res; 121 int res;
122 122
123 tty_port_init(&nfcon_tty_port);
124
125 stderr_id = nf_get_id("NF_STDERR"); 123 stderr_id = nf_get_id("NF_STDERR");
126 if (!stderr_id) 124 if (!stderr_id)
127 return -ENODEV; 125 return -ENODEV;
@@ -130,6 +128,8 @@ static int __init nfcon_init(void)
130 if (!nfcon_tty_driver) 128 if (!nfcon_tty_driver)
131 return -ENOMEM; 129 return -ENOMEM;
132 130
131 tty_port_init(&nfcon_tty_port);
132
133 nfcon_tty_driver->driver_name = "nfcon"; 133 nfcon_tty_driver->driver_name = "nfcon";
134 nfcon_tty_driver->name = "nfcon"; 134 nfcon_tty_driver->name = "nfcon";
135 nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM; 135 nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
@@ -143,6 +143,7 @@ static int __init nfcon_init(void)
143 if (res) { 143 if (res) {
144 pr_err("failed to register nfcon tty driver\n"); 144 pr_err("failed to register nfcon tty driver\n");
145 put_tty_driver(nfcon_tty_driver); 145 put_tty_driver(nfcon_tty_driver);
146 tty_port_destroy(&nfcon_tty_port);
146 return res; 147 return res;
147 } 148 }
148 149
@@ -157,6 +158,7 @@ static void __exit nfcon_exit(void)
157 unregister_console(&nf_console); 158 unregister_console(&nf_console);
158 tty_unregister_driver(nfcon_tty_driver); 159 tty_unregister_driver(nfcon_tty_driver);
159 put_tty_driver(nfcon_tty_driver); 160 put_tty_driver(nfcon_tty_driver);
161 tty_port_destroy(&nfcon_tty_port);
160} 162}
161 163
162module_init(nfcon_init); 164module_init(nfcon_init);