diff options
Diffstat (limited to 'drivers/isdn/gigaset/interface.c')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 4 |
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) | |||
161 | tty->driver_data = NULL; | 161 | tty->driver_data = NULL; |
162 | 162 | ||
163 | cs = gigaset_get_cs_by_tty(tty); | 163 | cs = gigaset_get_cs_by_tty(tty); |
164 | if (!cs) | 164 | if (!cs || !try_module_get(cs->driver->owner)) |
165 | return -ENODEV; | 165 | return -ENODEV; |
166 | 166 | ||
167 | if (mutex_lock_interruptible(&cs->mutex)) | 167 | if (mutex_lock_interruptible(&cs->mutex)) |
@@ -207,6 +207,8 @@ static void if_close(struct tty_struct *tty, struct file *filp) | |||
207 | } | 207 | } |
208 | 208 | ||
209 | mutex_unlock(&cs->mutex); | 209 | mutex_unlock(&cs->mutex); |
210 | |||
211 | module_put(cs->driver->owner); | ||
210 | } | 212 | } |
211 | 213 | ||
212 | static int if_ioctl(struct tty_struct *tty, struct file *file, | 214 | static int if_ioctl(struct tty_struct *tty, struct file *file, |