hfp_hf_bluez5: Remove Card when SLC fails
authorClaudio Takahasi <claudio.takahasi@openbossa.org>
Thu, 28 Feb 2013 16:01:07 +0000 (13:01 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 28 Feb 2013 16:10:30 +0000 (10:10 -0600)
This patch removes the previously created Audio Card if the service
level negotiation fails.

plugins/hfp_hf_bluez5.c

index 3960d7a..98cef7c 100644 (file)
@@ -112,6 +112,9 @@ static void slc_failed(gpointer userdata)
        ofono_error("Service level connection failed");
        ofono_modem_set_powered(modem, FALSE);
 
+       ofono_handsfree_card_remove(hfp->card);
+       hfp->card = NULL;
+
        g_at_chat_unref(info->chat);
        info->chat = NULL;
 }