From: Jiri Slaby Date: Sat, 30 Dec 2006 00:47:34 +0000 (-0800) Subject: [PATCH] Char: mxser, fix oops when removing opened X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=31f87cf48d54f5930e6e8e827989c18b0069c94a;p=openwrt%2Fstaging%2Fblogic.git [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: Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index c063359baf78..83f604b19290 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -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; diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index cd989dce7c53..1bb030b3a51a 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c @@ -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;