Skip to content

Commit

Permalink
[PATCH] Char: mxser, fix oops when removing opened
Browse files Browse the repository at this point in the history
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: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Dec 30, 2006
1 parent 76e6a1d commit 31f87cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/char/mxser.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ static int mxser_init(void)

/* Initialize the tty_driver structure */
memset(mxvar_sdriver, 0, sizeof(struct tty_driver));
mxvar_sdriver->owner = THIS_MODULE;
mxvar_sdriver->magic = TTY_DRIVER_MAGIC;
mxvar_sdriver->name = "ttyMI";
mxvar_sdriver->major = ttymajor;
Expand Down
1 change: 1 addition & 0 deletions drivers/char/mxser_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,7 @@ static int __init mxser_module_init(void)
MXSER_VERSION);

/* Initialize the tty_driver structure */
mxvar_sdriver->owner = THIS_MODULE;
mxvar_sdriver->magic = TTY_DRIVER_MAGIC;
mxvar_sdriver->name = "ttyMI";
mxvar_sdriver->major = ttymajor;
Expand Down

0 comments on commit 31f87cf

Please sign in to comment.