[svn-commits] rmudgett: branch 1.8 r333784 - /branches/1.8/addons/chan_mobile.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 29 16:05:47 CDT 2011


Author: rmudgett
Date: Mon Aug 29 16:05:43 2011
New Revision: 333784

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333784
Log:
Fix deadlock potential of chan_mobile.c:mbl_ast_hangup().

Modified:
    branches/1.8/addons/chan_mobile.c

Modified: branches/1.8/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/addons/chan_mobile.c?view=diff&rev=333784&r1=333783&r2=333784
==============================================================================
--- branches/1.8/addons/chan_mobile.c (original)
+++ branches/1.8/addons/chan_mobile.c Mon Aug 29 16:05:43 2011
@@ -1321,21 +1321,10 @@
 
 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;
-	}
-	return res;
+	if (pvt->owner) {
+		ast_hangup(pvt->owner);
+	}
+	return 0;
 }
 
 /*!




More information about the svn-commits mailing list