From bc3f2cff83f56e0db55f6d6aa8cc6fc1962c5008 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 19 Feb 2018 14:51:50 +0200 Subject: [PATCH] device: Fix probing service twice If there is already a service for a given profile there is no point in probing it again. --- src/device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/device.c b/src/device.c index 1acecce33..0da4184f6 100644 --- a/src/device.c +++ b/src/device.c @@ -4202,6 +4202,7 @@ static struct btd_service *probe_service(struct btd_device *device, struct btd_profile *profile, GSList *uuids) { + GSList *l; struct btd_service *service; if (profile->device_probe == NULL) @@ -4210,6 +4211,10 @@ static struct btd_service *probe_service(struct btd_device *device, 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)) { -- 2.47.3