The Audio Card is being created when the NewConnection from BlueZ
Profile is received, and registered when the service level connection
negotiation finishes. This patch rejects SCO connection if the SCO
incoming connection arrives when the service level negotiation is
ongoing.
---
 src/handsfree-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 14872b0..857c258 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -138,7 +138,7 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition 
cond,
        bt_ba2str(&saddr.sco_bdaddr, local);
 
        card = card_find(remote, local);
-       if (card == NULL) {
+       if (card == NULL || card->path == NULL) {
                ofono_error("Rejecting SCO: Audio Card not found!");
                close(nsk);
                return TRUE;
-- 
1.7.11.7

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to