Commit 0f24aeb8 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/tty-2.5

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 9b18b619 0f2721b9
......@@ -833,6 +833,11 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty)
* and locked termios may be retained.)
*/
if (!try_module_get(driver->owner)) {
retval = -ENODEV;
goto end_init;
}
o_tty = NULL;
tp = o_tp = NULL;
ltp = o_ltp = NULL;
......@@ -991,6 +996,7 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty)
free_tty_struct(tty);
fail_no_mem:
module_put(driver->owner);
retval = -ENOMEM;
goto end_init;
......@@ -1033,6 +1039,7 @@ static void release_mem(struct tty_struct *tty, int idx)
tty->magic = 0;
(*tty->driver.refcount)--;
list_del(&tty->tty_files);
module_put(tty->driver.owner);
free_tty_struct(tty);
}
......
......@@ -120,6 +120,7 @@
struct tty_driver {
int magic; /* magic number for this structure */
struct module *owner;
const char *driver_name;
const char *name;
int name_base; /* offset of printed name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment