[svn-commits] kpfleming: linux/trunk r6699 - /linux/trunk/drivers/dahdi/hpec/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 23 15:32:05 CDT 2009


Author: kpfleming
Date: Tue Jun 23 15:32:01 2009
New Revision: 6699

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6699
Log:
Use the same mutex lock for channel allocation and license checking in dahdi_echocan_hpec, so that channel allocation won't happen while the license is being checked (or rechecked)


Modified:
    linux/trunk/drivers/dahdi/hpec/dahdi_echocan_hpec.c

Modified: linux/trunk/drivers/dahdi/hpec/dahdi_echocan_hpec.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/hpec/dahdi_echocan_hpec.c?view=diff&rev=6699&r1=6698&r2=6699
==============================================================================
--- linux/trunk/drivers/dahdi/hpec/dahdi_echocan_hpec.c (original)
+++ linux/trunk/drivers/dahdi/hpec/dahdi_echocan_hpec.c Tue Jun 23 15:32:01 2009
@@ -114,7 +114,7 @@
 	hpec_channel_update(pvt->hpec, isig, iref);
 }
 
-DECLARE_MUTEX(alloc_lock);
+DECLARE_MUTEX(license_lock);
 
 static int echo_can_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
 			   struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec)
@@ -133,12 +133,12 @@
 	pvt->dahdi.ops = &my_ops;
 	pvt->dahdi.features = my_features;
 
-	if (down_interruptible(&alloc_lock))
+	if (down_interruptible(&license_lock))
 		return -ENOTTY;
 
 	pvt->hpec = hpec_channel_alloc(ecp->tap_length);
 
-	up(&alloc_lock);
+	up(&license_lock);
 
 	if (!pvt->hpec) {
 		kfree(pvt);
@@ -154,8 +154,6 @@
 {
 	return 1;
 }
-
-DECLARE_MUTEX(license_lock);
 
 static int hpec_license_ioctl(unsigned int cmd, unsigned long data)
 {




More information about the svn-commits mailing list