提交 dc6802a7 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

tty: handle NULL parameters in free_tty_struct()

We sometimes pass NULL pointers to free_tty_struct().  One example where
it can happen is in the error handling code in pty_common_install().
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4ac5d705
......@@ -181,6 +181,8 @@ struct tty_struct *alloc_tty_struct(void)
void free_tty_struct(struct tty_struct *tty)
{
if (!tty)
return;
if (tty->dev)
put_device(tty->dev);
kfree(tty->write_buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册