summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zaptel.c b/zaptel.c
index a1f2f8d..2afd616 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -4080,19 +4080,21 @@ static int zt_chan_ioctl(struct inode *inode, struct file *file, unsigned int cm
rv = 0;
break;
case ZT_HOOK:
+ get_user(j,(int *)data);
if (chan->flags & ZT_FLAG_CLEAR)
return -EINVAL;
if (chan->sig == ZT_SIG_CAS)
return -EINVAL;
/* if no span, just do nothing */
if (!chan->span) return(0);
+ spin_lock_irqsave(&chan->lock, flags);
/* if dialing, stop it */
chan->curtone = NULL;
chan->dialing = 0;
chan->txdialbuf[0] = '\0';
chan->tonep = 0;
chan->pdialcount = 0;
- get_user(j,(int *)data);
+ spin_unlock_irqrestore(&chan->lock, flags);
if (chan->span->flags & ZT_FLAG_RBS) {
switch (j) {
case ZT_ONHOOK: