From: Russell Bryant Date: Wed, 23 Apr 2008 17:16:32 +0000 (+0000) Subject: Fix find_callno_locked() to actually return the callno locked in some more cases. X-Git-Tag: 1.4.20-rc1~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=694a6b4abb75c6d232ff50e962b1a331357dddf1;p=thirdparty%2Fasterisk.git Fix find_callno_locked() to actually return the callno locked in some more cases. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114587 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 823c4a3c7d..f30ea54f8b 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1353,7 +1353,8 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s res = x; } } - ast_mutex_unlock(&iaxsl[x]); + if (res && !return_locked) + ast_mutex_unlock(&iaxsl[x]); } for (x=TRUNK_CALL_START;(res < 1) && (x= NEW_ALLOW)) {