Commit 31f87cf4 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: mxser, fix oops when removing opened

tty_driver->owner is not set, so if somebody remove mxser_module, it might
oops (and doesn't tell the user: no way, it's in use). Set the .owner value.

Cc: <osv@javad.com>
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 76e6a1d6
...@@ -717,6 +717,7 @@ static int mxser_init(void) ...@@ -717,6 +717,7 @@ static int mxser_init(void)
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
memset(mxvar_sdriver, 0, sizeof(struct tty_driver)); memset(mxvar_sdriver, 0, sizeof(struct tty_driver));
mxvar_sdriver->owner = THIS_MODULE;
mxvar_sdriver->magic = TTY_DRIVER_MAGIC; mxvar_sdriver->magic = TTY_DRIVER_MAGIC;
mxvar_sdriver->name = "ttyMI"; mxvar_sdriver->name = "ttyMI";
mxvar_sdriver->major = ttymajor; mxvar_sdriver->major = ttymajor;
......
...@@ -2690,6 +2690,7 @@ static int __init mxser_module_init(void) ...@@ -2690,6 +2690,7 @@ static int __init mxser_module_init(void)
MXSER_VERSION); MXSER_VERSION);
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
mxvar_sdriver->owner = THIS_MODULE;
mxvar_sdriver->magic = TTY_DRIVER_MAGIC; mxvar_sdriver->magic = TTY_DRIVER_MAGIC;
mxvar_sdriver->name = "ttyMI"; mxvar_sdriver->name = "ttyMI";
mxvar_sdriver->major = ttymajor; mxvar_sdriver->major = ttymajor;
......
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