bluetooth: Assert transport has a matching profile
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 22 Aug 2014 08:07:12 +0000 (11:07 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 22 Aug 2014 09:24:39 +0000 (12:24 +0300)
It is a bug if a transport has no matching profile.

src/modules/bluetooth/module-bluez5-device.c

index 77964c12994c1664c13deb265569985ca9f1143e..5398a1b5f8239db008edf948366d46721509ca19 100644 (file)
@@ -1890,10 +1890,8 @@ static void handle_transport_state_change(struct userdata *u, struct pa_bluetoot
 
     pa_assert(u);
     pa_assert(t);
+    pa_assert_se(cp = pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile)));
 
-    /* Update profile availability */
-    if (!(cp = pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile))))
-        return;
     pa_card_profile_set_available(cp, transport_state_to_availability(t->state));
 
     /* Update port availability */