aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 16:54:38 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-09 16:54:38 +0000
commit7347af6efd5556d46826cf29374c01f86fc2c999 (patch)
tree393a63bcada3a4fde71a707ed9aa921c3afbf3ba /channels
parent152a45decb54b0a335b4089e0b8d7d1561bcd5c1 (diff)
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. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269307 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index a71f3abdc..d054323f5 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -7085,9 +7085,6 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
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 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
update_conf(p);
ast_mutex_unlock(&p->lock);
+
+ if (newchan->_state == AST_STATE_RINGING) {
+ dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
+ }
return 0;
}