From 0ee5fa6377dcb0d6120f9a11bf68a10ef5eed320 Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Fri, 31 Aug 2012 12:50:59 +0200 Subject: [PATCH] bluetooth: Fix check if transport exists before acquire The transport might have disapeared exactly before acquiring, so we should avoid an assertion failure, in this case inside the function pa_bluetooth_discovery_get_by_path(). --- src/modules/bluetooth/module-bluetooth-device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 51ee92f23..7a7ccff08 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -327,6 +327,11 @@ static int bt_transport_acquire(struct userdata *u, pa_bool_t start) { const char *accesstype = "rw"; const pa_bluetooth_transport *t; + if (u->transport == NULL) { + pa_log("Transport no longer available."); + return -1; + } + if (bt_transport_is_acquired(u)) { if (start) goto done;