From: Mikel Astiz Date: Fri, 31 Aug 2012 10:50:59 +0000 (+0200) Subject: bluetooth: Fix check if transport exists before acquire X-Git-Tag: accepted/2.0alpha/20130128.165422~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3124a216b11792eddef410a3974b09991e87019a;p=profile%2Fivi%2Fpulseaudio.git 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(). --- diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index c83fc80..8da0d7e 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -326,6 +326,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;