[asterisk-commits] rmudgett: trunk r269307 - /trunk/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 9 11:54:42 CDT 2010


Author: rmudgett
Date: Wed Jun  9 11:54:38 2010
New Revision: 269307

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=269307
Log:
Eliminate deadlock potential in dahdi_fixup().

Calling dahdi_indicate() within dahdi_fixup() while the owner pointers are
in a potentially inconsistent state is a potentially bad thing in
principle.

However, calling dahdi_indicate() when the channel private lock is already
held can cause a deadlock if the PRI lock is needed because
dahdi_indicate() will also get the channel private lock.  The pri_grab()
function assumes that the channel private lock is held once to avoid
deadlock.

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=269307&r1=269306&r2=269307
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Wed Jun  9 11:54:38 2010
@@ -7085,9 +7085,6 @@
 				dahdi_unlink(NULL, p, 0);
 			p->subs[x].owner = newchan;
 		}
-	if (newchan->_state == AST_STATE_RINGING)
-		dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
-
 	if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
 		analog_fixup(oldchan, newchan, p->sig_pvt);
 	} 
@@ -7099,6 +7096,10 @@
 
 	update_conf(p);
 	ast_mutex_unlock(&p->lock);
+
+	if (newchan->_state == AST_STATE_RINGING) {
+		dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
+	}
 	return 0;
 }
 




More information about the asterisk-commits mailing list