]> code.delx.au - pulseaudio/blobdiff - src/modules/bluetooth/bluez5-util.c
bluetooth: Fix a copy-paste error in log message
[pulseaudio] / src / modules / bluetooth / bluez5-util.c
index d2893c0a8d622bcd7a2eae3ce923cd9cb0b0878f..a57322b8a7c09cd1b831558369f70c03c83f49b3 100644 (file)
@@ -395,8 +395,8 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_device_by_address(pa_bluetooth_d
     pa_assert(local);
 
     while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
-        if (pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
-            return d->device_info_valid == 1 ? d : NULL;
+        if (d->device_info_valid == 1 && pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
+            return d;
 
     return NULL;
 }
@@ -419,11 +419,10 @@ static void device_free(pa_bluetooth_device *d) {
     if (d->uuids)
         pa_hashmap_free(d->uuids);
 
-    d->discovery = NULL;
-    d->adapter = NULL;
     pa_xfree(d->path);
     pa_xfree(d->alias);
     pa_xfree(d->address);
+    pa_xfree(d->adapter_path);
     pa_xfree(d);
 }
 
@@ -780,7 +779,7 @@ static void parse_interfaces_and_properties(pa_bluetooth_discovery *y, DBusMessa
             pa_bluetooth_adapter *a;
 
             if ((a = pa_hashmap_get(y->adapters, path))) {
-                pa_log_error("Found duplicated D-Bus path for device %s", path);
+                pa_log_error("Found duplicated D-Bus path for adapter %s", path);
                 return;
             } else
                 a = adapter_create(y, path);
@@ -1232,7 +1231,7 @@ static DBusMessage *endpoint_set_configuration(DBusConnection *conn, DBusMessage
             goto fail2;
         }
     } else {
-        /* InterfacesAdded signal is probably on it's way, device_info_valid is kept as 0. */
+        /* InterfacesAdded signal is probably on its way, device_info_valid is kept as 0. */
         pa_log_warn("SetConfiguration() received for unknown device %s", dev_path);
         d = device_create(y, dev_path);
     }