From: Richard Mudgett Date: Mon, 29 Aug 2011 21:05:43 +0000 (+0000) Subject: Fix deadlock potential of chan_mobile.c:mbl_ast_hangup(). X-Git-Tag: 1.8.7.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97959f3e9a2df2713f5407d61c327a932a0c5b89;p=thirdparty%2Fasterisk.git Fix deadlock potential of chan_mobile.c:mbl_ast_hangup(). git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@333784 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/chan_mobile.c b/addons/chan_mobile.c index 75059e5478..a725cc5a61 100644 --- a/addons/chan_mobile.c +++ b/addons/chan_mobile.c @@ -1321,21 +1321,10 @@ static int mbl_queue_hangup(struct mbl_pvt *pvt) static int mbl_ast_hangup(struct mbl_pvt *pvt) { - int res = 0; - for (;;) { - if (pvt->owner) { - if (ast_channel_trylock(pvt->owner)) { - DEADLOCK_AVOIDANCE(&pvt->lock); - } else { - res = ast_hangup(pvt->owner); - /* no need to unlock, ast_hangup() frees the - * channel */ - break; - } - } else - break; + if (pvt->owner) { + ast_hangup(pvt->owner); } - return res; + return 0; } /*!