Message ID | 1467715239-18833-1-git-send-email-colin.king@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index e198996..9e45c57 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -667,8 +667,11 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) fsi = tty->driver_data; else fsi = tty->link->driver_data; - devpts_kill_index(fsi, tty->index); - devpts_put_ref(fsi); + + if (fsi) { + devpts_kill_index(fsi, tty->index); + devpts_put_ref(fsi); + } } static const struct tty_operations ptm_unix98_ops = {