From 8da8df121d005cafc54a0a01808c0f97cefc4eb9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 21 Nov 2014 16:31:43 +0200 Subject: [PATCH] audio/source: Fix XCASE connection In case the remote has initiate a connection already the code should return -EBUSY to avoid possible command collisions on AVDTP session. --- profiles/audio/source.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/source.c b/profiles/audio/source.c index b0abaa3a3..aca2fcb24 100644 --- a/profiles/audio/source.c +++ b/profiles/audio/source.c @@ -293,6 +293,9 @@ int source_connect(struct btd_service *service) if (source->connect_id > 0 || source->disconnect_id > 0) return -EBUSY; + if (source->state == SOURCE_STATE_CONNECTING) + return -EBUSY; + if (source->stream_state >= AVDTP_STATE_OPEN) return -EALREADY; -- 2.47.3