]> code.delx.au - pulseaudio/commitdiff
bluetooth: Check adapter address to set device_info_valid
authorJoão Paulo Rechi Vita <jprvita@gmail.com>
Wed, 20 Nov 2013 21:21:35 +0000 (18:21 -0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 22 Nov 2013 16:39:36 +0000 (18:39 +0200)
If the adapter object has no address information the device information
should be marked as invalid.

src/modules/bluetooth/bluez5-util.c

index c8ff219939e5c7de5f1262a5b941765ce53f97ed..d2893c0a8d622bcd7a2eae3ce923cd9cb0b0878f 100644 (file)
@@ -820,8 +820,8 @@ static void parse_interfaces_and_properties(pa_bluetooth_discovery *y, DBusMessa
 
         if (!d->adapter && d->adapter_path) {
             d->adapter = pa_hashmap_get(d->discovery->adapters, d->adapter_path);
-            if (!d->adapter) {
-                pa_log_error("Device %s is child of nonexistent adapter %s", d->path, d->adapter_path);
+            if (!d->adapter || !d->adapter->address) {
+                pa_log_error("Device %s is child of nonexistent or corrupted adapter %s", d->path, d->adapter_path);
                 set_device_info_valid(d, -1);
             } else
                 set_device_info_valid(d, 1);