summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-17 17:55:26 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-11-17 17:55:26 -0300
commit9b953c8757093b51eb86e6593d514e9839fd8d7d (patch)
treeea80fd890895b87a5d6036a23e0f7aa46424c481
parent7ec871d37de442fd3731a0eef319851c61fb04cc (diff)
Prevent duplicated uuids from being probed.
Since probe takes the device object and the uuid list it make no sense to have duplicated uuid being probed, since the driver wouldn't detect any difference between them (fetching from the cache would return the very same record).
-rw-r--r--src/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 64d5c08d..04ebfd39 100644
--- a/src/device.c
+++ b/src/device.c
@@ -656,6 +656,11 @@ static GSList *device_match_driver(struct btd_device *device,
for (uuid = driver->uuids; *uuid; uuid++) {
GSList *match;
+ /* skip duplicated uuids */
+ if (g_slist_find_custom(uuids, *uuid,
+ (GCompareFunc) strcasecmp))
+ continue;
+
/* match profile driver */
match = g_slist_find_custom(profiles, *uuid,
(GCompareFunc) strcasecmp);