[Asterisk-cvs] zaptel zaptel.c,1.95.2.1,1.95.2.2

russell at lists.digium.com russell at lists.digium.com
Wed Jan 12 22:40:41 CST 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv17108

Modified Files:
      Tag: v1-0
	zaptel.c 
Log Message:
lock some parameters (bug #3312)


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.95.2.1
retrieving revision 1.95.2.2
diff -u -d -r1.95.2.1 -r1.95.2.2
--- zaptel.c	6 Oct 2004 22:11:41 -0000	1.95.2.1
+++ zaptel.c	13 Jan 2005 04:44:39 -0000	1.95.2.2
@@ -4080,19 +4080,21 @@
 		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:




More information about the svn-commits mailing list