aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/hso.c
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 /drivers/net/usb/hso.c
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 'drivers/net/usb/hso.c')
-rw-r--r--drivers/net/usb/hso.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 605a4baa9b7b..cd8ccb240f4b 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2274,6 +2274,7 @@ static void hso_serial_common_free(struct hso_serial *serial)
2274 /* unlink and free TX URB */ 2274 /* unlink and free TX URB */
2275 usb_free_urb(serial->tx_urb); 2275 usb_free_urb(serial->tx_urb);
2276 kfree(serial->tx_data); 2276 kfree(serial->tx_data);
2277 tty_port_destroy(&serial->port);
2277} 2278}
2278 2279
2279static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, 2280static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
@@ -2283,12 +2284,12 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
2283 int minor; 2284 int minor;
2284 int i; 2285 int i;
2285 2286
2287 tty_port_init(&serial->port);
2288
2286 minor = get_free_serial_index(); 2289 minor = get_free_serial_index();
2287 if (minor < 0) 2290 if (minor < 0)
2288 goto exit; 2291 goto exit;
2289 2292
2290 tty_port_init(&serial->port);
2291
2292 /* register our minor number */ 2293 /* register our minor number */
2293 serial->parent->dev = tty_port_register_device(&serial->port, tty_drv, 2294 serial->parent->dev = tty_port_register_device(&serial->port, tty_drv,
2294 minor, &serial->parent->interface->dev); 2295 minor, &serial->parent->interface->dev);