diff options
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 76b27932d229..ec09c1cd4fe9 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -388,7 +388,14 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, | |||
388 | return -ENOIOCTLCMD; | 388 | return -ENOIOCTLCMD; |
389 | } | 389 | } |
390 | 390 | ||
391 | static const struct tty_operations pty_unix98_ops = { | 391 | static void pty_shutdown(struct tty_struct *tty) |
392 | { | ||
393 | /* We have our own method as we don't use the tty index */ | ||
394 | kfree(tty->termios); | ||
395 | kfree(tty->termios_locked); | ||
396 | } | ||
397 | |||
398 | static const struct tty_operations ptm_unix98_ops = { | ||
392 | .open = pty_open, | 399 | .open = pty_open, |
393 | .close = pty_close, | 400 | .close = pty_close, |
394 | .write = pty_write, | 401 | .write = pty_write, |
@@ -397,10 +404,10 @@ static const struct tty_operations pty_unix98_ops = { | |||
397 | .chars_in_buffer = pty_chars_in_buffer, | 404 | .chars_in_buffer = pty_chars_in_buffer, |
398 | .unthrottle = pty_unthrottle, | 405 | .unthrottle = pty_unthrottle, |
399 | .set_termios = pty_set_termios, | 406 | .set_termios = pty_set_termios, |
400 | .ioctl = pty_unix98_ioctl | 407 | .ioctl = pty_unix98_ioctl, |
408 | .shutdown = pty_shutdown | ||
401 | }; | 409 | }; |
402 | 410 | ||
403 | |||
404 | static void __init unix98_pty_init(void) | 411 | static void __init unix98_pty_init(void) |
405 | { | 412 | { |
406 | ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX); | 413 | ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX); |
@@ -427,7 +434,7 @@ static void __init unix98_pty_init(void) | |||
427 | ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | | 434 | ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | |
428 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; | 435 | TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM; |
429 | ptm_driver->other = pts_driver; | 436 | ptm_driver->other = pts_driver; |
430 | tty_set_operations(ptm_driver, &pty_unix98_ops); | 437 | tty_set_operations(ptm_driver, &ptm_unix98_ops); |
431 | 438 | ||
432 | pts_driver->owner = THIS_MODULE; | 439 | pts_driver->owner = THIS_MODULE; |
433 | pts_driver->driver_name = "pty_slave"; | 440 | pts_driver->driver_name = "pty_slave"; |