|
@@ -388,7 +388,14 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
|
|
return -ENOIOCTLCMD;
|
|
return -ENOIOCTLCMD;
|
|
}
|
|
}
|
|
|
|
|
|
-static const struct tty_operations pty_unix98_ops = {
|
|
|
|
|
|
+static void pty_shutdown(struct tty_struct *tty)
|
|
|
|
+{
|
|
|
|
+ /* We have our own method as we don't use the tty index */
|
|
|
|
+ kfree(tty->termios);
|
|
|
|
+ kfree(tty->termios_locked);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const struct tty_operations ptm_unix98_ops = {
|
|
.open = pty_open,
|
|
.open = pty_open,
|
|
.close = pty_close,
|
|
.close = pty_close,
|
|
.write = pty_write,
|
|
.write = pty_write,
|
|
@@ -397,10 +404,10 @@ static const struct tty_operations pty_unix98_ops = {
|
|
.chars_in_buffer = pty_chars_in_buffer,
|
|
.chars_in_buffer = pty_chars_in_buffer,
|
|
.unthrottle = pty_unthrottle,
|
|
.unthrottle = pty_unthrottle,
|
|
.set_termios = pty_set_termios,
|
|
.set_termios = pty_set_termios,
|
|
- .ioctl = pty_unix98_ioctl
|
|
|
|
|
|
+ .ioctl = pty_unix98_ioctl,
|
|
|
|
+ .shutdown = pty_shutdown
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
static void __init unix98_pty_init(void)
|
|
static void __init unix98_pty_init(void)
|
|
{
|
|
{
|
|
ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX);
|
|
ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX);
|
|
@@ -427,7 +434,7 @@ static void __init unix98_pty_init(void)
|
|
ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW |
|
|
ptm_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW |
|
|
TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM;
|
|
TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_DEVPTS_MEM;
|
|
ptm_driver->other = pts_driver;
|
|
ptm_driver->other = pts_driver;
|
|
- tty_set_operations(ptm_driver, &pty_unix98_ops);
|
|
|
|
|
|
+ tty_set_operations(ptm_driver, &ptm_unix98_ops);
|
|
|
|
|
|
pts_driver->owner = THIS_MODULE;
|
|
pts_driver->owner = THIS_MODULE;
|
|
pts_driver->driver_name = "pty_slave";
|
|
pts_driver->driver_name = "pty_slave";
|