[dahdi-commits] kpfleming: branch linux/kpfleming/echocan_work r6368 - /linux/team/kpfleming/...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Apr 14 17:08:33 CDT 2009
Author: kpfleming
Date: Tue Apr 14 17:08:29 2009
New Revision: 6368
URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6368
Log:
add proper locking to two ioctl calls and remove some extraneous variable setting
Modified:
linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c?view=diff&rev=6368&r1=6367&r2=6368
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c Tue Apr 14 17:08:29 2009
@@ -5224,28 +5224,30 @@
j <<= 3;
if (chan->ec_state) {
/* Start pretraining stage */
+ spin_lock_irqsave(&chan->lock, flags);
chan->echostate = ECHO_STATE_PRETRAINING;
chan->echotimer = j;
+ spin_unlock_irqrestore(&chan->lock, flags);
} else
return -EINVAL;
break;
case DAHDI_ECHOCANCEL_FAX_MODE:
if (!chan->ec_state) {
return -EINVAL;
- }
- set_echocan_fax_mode(chan, chan->channo, "ioctl");
- rv = 0;
+ } else {
+ spin_lock_irqsave(&chan->lock, flags);
+ set_echocan_fax_mode(chan, chan->channo, "ioctl");
+ spin_unlock_irqrestore(&chan->lock, flags);
+ }
break;
case DAHDI_SETTXBITS:
if (chan->sig != DAHDI_SIG_CAS)
return -EINVAL;
get_user(j,(int *)data);
dahdi_cas_setbits(chan, j);
- rv = 0;
break;
case DAHDI_GETRXBITS:
put_user(chan->rxsig, (int *)data);
- rv = 0;
break;
case DAHDI_LOOPBACK:
get_user(j, (int *)data);
@@ -5255,7 +5257,6 @@
else
chan->flags &= ~DAHDI_FLAG_LOOPED;
spin_unlock_irqrestore(&chan->lock, flags);
- rv = 0;
break;
case DAHDI_HOOK:
get_user(j,(int *)data);
@@ -5316,7 +5317,6 @@
rv = schluffen(&chan->txstateq);
if (rv) return rv;
#endif
- rv = 0;
break;
case DAHDI_WINK:
spin_lock_irqsave(&chan->lock, flags);
More information about the dahdi-commits
mailing list