]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
avoyding dedwock
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Apr 2009 19:37:42 +0000 (19:37 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Apr 2009 19:37:42 +0000 (19:37 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@717 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/zap_io.c

index c2219d309ff585bf99f8a5e73de8111939678e53..aea2ae3e422d13b46d936f0c8a92b0af06da316b 100644 (file)
@@ -942,7 +942,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
        }
        
        zap_mutex_lock(span->mutex);
-               
+       
        if (direction == ZAP_TOP_DOWN) {
                i = 1;
        } else {
@@ -963,8 +963,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
                        
                if (!(check = span->channels[i])) {
                        status = ZAP_FAIL;
-                       zap_mutex_unlock(span->mutex);
-                       goto done;
+                       break;
                }
                        
                if (zap_test_flag(check, ZAP_CHANNEL_READY) && 
@@ -975,8 +974,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
 
                        if (span && span->channel_request) {
                                status = span->channel_request(span, i, direction, caller_data, zchan);
-                               zap_mutex_unlock(span->mutex);
-                               goto done;
+                               break;
                        }
 
                        status = check->zio->open(check);
@@ -985,8 +983,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
                                zap_set_flag(check, ZAP_CHANNEL_INUSE);
                                zap_channel_open_chan(check);
                                *zchan = check;
-                               zap_mutex_unlock(span->mutex);
-                               goto done;
+                               break;
                        }
                }
                
@@ -997,8 +994,8 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
                }
        }
 
- done:
-       
+       zap_mutex_unlock(span->mutex);
+
        return status;
 }