device: Fix probing service twice
If there is already a service for a given profile there is no point in
probing it again.
diff --git a/src/device.c b/src/device.c
index 1acecce..0da4184 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4202,6 +4202,7 @@
struct btd_profile *profile,
GSList *uuids)
{
+ GSList *l;
struct btd_service *service;
if (profile->device_probe == NULL)
@@ -4210,6 +4211,10 @@
if (!device_match_profile(device, profile, uuids))
return NULL;
+ l = find_service_with_profile(device->services, profile);
+ if (l)
+ return l->data;
+
service = service_create(device, profile);
if (service_probe(service)) {