From 165be1ce385571158a7541671f3bf8b26146d8eb Mon Sep 17 00:00:00 2001 From: russell Date: Thu, 13 Jan 2005 04:44:39 +0000 Subject: lock some parameters (bug #3312) git-svn-id: http://svn.digium.com/svn/zaptel/branches/v1-0@545 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'zaptel.c') 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: -- cgit v1.2.3