From dd7593b83669d84d3aa02597a61e37c74123da50 Mon Sep 17 00:00:00 2001 From: morrishoresh Date: Thu, 24 Dec 2020 23:58:54 +0200 Subject: [PATCH] bluetooth: correct possible segmentation fault Part-of: --- src/modules/bluetooth/backend-ofono.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c index 0e5bbe8b7..d7a13efd0 100644 --- a/src/modules/bluetooth/backend-ofono.c +++ b/src/modules/bluetooth/backend-ofono.c @@ -627,8 +627,6 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage card = pa_hashmap_get(backend->cards, path); - card->connecting = false; - if (!card || codec != HFP_AUDIO_CODEC_CVSD || card->fd >= 0) { pa_log_warn("New audio connection invalid arguments (path=%s fd=%d, codec=%d)", path, fd, codec); pa_assert_se(r = dbus_message_new_error(m, "org.ofono.Error.InvalidArguments", "Invalid arguments in method call")); @@ -639,6 +637,7 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage pa_log_debug("New audio connection on card %s (fd=%d, codec=%d)", path, fd, codec); + card->connecting = false; card->fd = fd; card->transport->codec = codec;