diff --git a/src/shared/bap.c b/src/shared/bap.c
index ec54da3..defeeb6 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
static uint8_t stream_stop(struct bt_bap_stream *stream, struct iovec *rsp)
{
- DBG(stream->bap, "stream %p", stream);
-
if (!stream)
return 0;
+ DBG(stream->bap, "stream %p", stream);
+
ascs_ase_rsp_success(rsp, stream->ep->id);
stream_set_state(stream, BT_BAP_STREAM_STATE_QOS);
static uint8_t stream_disable(struct bt_bap_stream *stream, struct iovec *rsp)
{
- DBG(stream->bap, "stream %p", stream);
-
if (!stream || stream->ep->state == BT_BAP_STREAM_STATE_QOS ||
stream->ep->state == BT_BAP_STREAM_STATE_IDLE)
return 0;
+ DBG(stream->bap, "stream %p", stream);
+
ascs_ase_rsp_success(rsp, stream->ep->id);
/* Sink can autonomously transit to QOS while source needs to go to
int bt_bap_stream_io_link(struct bt_bap_stream *stream,
struct bt_bap_stream *link)
{
- struct bt_bap *bap = stream->bap;
+ struct bt_bap *bap;
if (!stream || !link || stream == link)
return -EINVAL;
+ bap = stream->bap;
+
if (stream->link || link->link)
return -EALREADY;