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-Tag: v2.6.28-rc7~30 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e5404586a499f7dce915456e85ff94b2df7a3b1c;p=linux-2.6-omap-h63xx.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;