[svn-commits] jpeeler: branch 1.4 r271335 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 18 13:33:22 CDT 2010


Author: jpeeler
Date: Fri Jun 18 13:33:17 2010
New Revision: 271335

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

(This is a backport of 269307, committed to trunk by rmudgett.)

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.

(closes issue #17261)
Reported by: aragon

Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=271335&r1=271334&r2=271335
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Fri Jun 18 13:33:17 2010
@@ -3938,10 +3938,10 @@
 				dahdi_unlink(NULL, p, 0);
 			p->subs[x].owner = newchan;
 		}
+	update_conf(p);
+	ast_mutex_unlock(&p->lock);
 	if (newchan->_state == AST_STATE_RINGING) 
 		dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
-	update_conf(p);
-	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 




More information about the svn-commits mailing list