diff options
author | Johan Hovold <johan@kernel.org> | 2015-02-16 01:17:33 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2015-02-26 11:06:39 -0500 |
commit | 5ee0089b1f7057d8f783db37b2a8116cd114f6e5 (patch) | |
tree | b5616499da8fb19ed5e81c4cf3a73e0696dda600 | |
parent | f6950344d3cf4a1e231b5828b50c4ac168db3886 (diff) |
USB: console: add dummy __module_get
Add call to __module_get when initialising the fake tty in
usb_console_setup to match the module_put in release_one_tty.
Note that the tty-driver (i.e. usb-serial core) must be compiled-in to
enable the usb console so the __module_get is essentially a noop as
driver->owner will be null.
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Johan Hovold <johan@kernel.org>
-rw-r--r-- | drivers/usb/serial/console.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 29fa1c3d0089..3806e7014199 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
15 | 15 | ||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/module.h> | ||
17 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
18 | #include <linux/tty.h> | 19 | #include <linux/tty.h> |
19 | #include <linux/console.h> | 20 | #include <linux/console.h> |
@@ -144,6 +145,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
144 | init_ldsem(&tty->ldisc_sem); | 145 | init_ldsem(&tty->ldisc_sem); |
145 | INIT_LIST_HEAD(&tty->tty_files); | 146 | INIT_LIST_HEAD(&tty->tty_files); |
146 | kref_get(&tty->driver->kref); | 147 | kref_get(&tty->driver->kref); |
148 | __module_get(tty->driver->owner); | ||
147 | tty->ops = &usb_console_fake_tty_ops; | 149 | tty->ops = &usb_console_fake_tty_ops; |
148 | if (tty_init_termios(tty)) { | 150 | if (tty_init_termios(tty)) { |
149 | retval = -ENOMEM; | 151 | retval = -ENOMEM; |