]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 269307 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Fri, 18 Jun 2010 18:40:34 +0000 (18:40 +0000)
committerJeff Peeler <jpeeler@digium.com>
Fri, 18 Jun 2010 18:40:34 +0000 (18:40 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r269307 | rmudgett | 2010-06-09 11:54:38 -0500 (Wed, 09 Jun 2010) | 12 lines

  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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@271338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 2a256f23bd9bafb9f1f81af6dfe70ab52e547692..d642fac12635d2fbe9dd00acefd90fee73c994e8 100644 (file)
@@ -5535,10 +5535,11 @@ 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);
        update_conf(p);
        ast_mutex_unlock(&p->lock);
+       if (newchan->_state == AST_STATE_RINGING) {
+               dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
+       }
        return 0;
 }