diff options
author | Kevin Hao <kexin.hao@windriver.com> | 2008-12-01 12:36:16 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-01 17:19:10 +0100 |
commit | e5404586a499f7dce915456e85ff94b2df7a3b1c (patch) | |
tree | 1e40e93b332e9e9399ab15345dc0c487d6237649 /drivers/usb/serial/console.c | |
parent | drivers/char/tty_io.c: Avoid panic when no console is configured. (diff) | |
download | linux-e5404586a499f7dce915456e85ff94b2df7a3b1c.tar.xz linux-e5404586a499f7dce915456e85ff94b2df7a3b1c.zip |
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 <kexin.hao@windriver.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r-- | drivers/usb/serial/console.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 5b20de130e08..5b95009d2fbb 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; |