}
zap_mutex_lock(span->mutex);
-
+
if (direction == ZAP_TOP_DOWN) {
i = 1;
} else {
if (!(check = span->channels[i])) {
status = ZAP_FAIL;
- zap_mutex_unlock(span->mutex);
- goto done;
+ break;
}
if (zap_test_flag(check, ZAP_CHANNEL_READY) &&
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);
zap_set_flag(check, ZAP_CHANNEL_INUSE);
zap_channel_open_chan(check);
*zchan = check;
- zap_mutex_unlock(span->mutex);
- goto done;
+ break;
}
}
}
}
- done:
-
+ zap_mutex_unlock(span->mutex);
+
return status;
}