diff options
author | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-01-13 04:44:39 +0000 |
---|---|---|
committer | russell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-01-13 04:44:39 +0000 |
commit | 165be1ce385571158a7541671f3bf8b26146d8eb (patch) | |
tree | 9c418bd3b584761b1d263af055d2b2d29e773e39 | |
parent | 5191414abb27b379d4cca4ccfb1e82c8e587fbdb (diff) |
lock some parameters (bug #3312)
git-svn-id: http://svn.digium.com/svn/zaptel/branches/v1-0@545 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | zaptel.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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: |