summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/interface.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2008-02-06 01:38:29 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:12 -0800
commite468c04894f36045cf93d1384183a461014b6840 (patch)
treeb734bbc4ee65f8282de5299dc200f47ea466067a /drivers/isdn/gigaset/interface.c
parent9d4bee2b9de9e30057a860d2d6794f874caffc5e (diff)
downloadlinux-e468c04894f36045cf93d1384183a461014b6840.tar.gz
linux-e468c04894f36045cf93d1384183a461014b6840.tar.bz2
linux-e468c04894f36045cf93d1384183a461014b6840.zip
Gigaset: permit module unload
Fix the initialization and reference counting of the Gigaset driver modules so that they can be unloaded when they are not actually in use. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Hansjoerg Lipp <hjlipp@web.de> Cc: Greg KH <gregkh@suse.de> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/gigaset/interface.c')
-rw-r--r--drivers/isdn/gigaset/interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index f4731c9984f6..af195b07c191 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -161,7 +161,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
tty->driver_data = NULL;
cs = gigaset_get_cs_by_tty(tty);
- if (!cs)
+ if (!cs || !try_module_get(cs->driver->owner))
return -ENODEV;
if (mutex_lock_interruptible(&cs->mutex))
@@ -207,6 +207,8 @@ static void if_close(struct tty_struct *tty, struct file *filp)
}
mutex_unlock(&cs->mutex);
+
+ module_put(cs->driver->owner);
}
static int if_ioctl(struct tty_struct *tty, struct file *file,