From: Kevin Hao Date: Mon, 1 Dec 2008 11:36:16 +0000 (+0000) Subject: Add kref to fake tty used by USB console X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e5404586a499f7dce915456e85ff94b2df7a3b1c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Add kref to fake tty used by USB console We alloc a fake tty in usb serial console setup function. we should init the tty's kref otherwise we will face WARN_ON after following invoke of tty_port_tty_set --> tty_kref_get. Signed-off-by: Kevin Hao Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 5b20de130e0..5b95009d2fb 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -135,6 +135,7 @@ static int usb_console_setup(struct console *co, char *options) err("no more memory"); goto reset_open_count; } + kref_init(&tty->kref); termios = kzalloc(sizeof(*termios), GFP_KERNEL); if (!termios) { retval = -ENOMEM;