summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-30 18:02:48 -0300
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-30 18:02:48 -0300
commit9b4bfa74d25e360932402994a32305bf2145eb34 (patch)
tree4d6da404e60941b2aa83ab4a99258537b41998e1 /src/device.c
parentd0c561820ca05cafc8a7d20e3250953b48aa5214 (diff)
Fix adapter removal.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index 45137d65..99bfdd4c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -682,10 +682,10 @@ void device_remove_drivers(struct btd_device *device, GSList *uuids, sdp_list_t
const char **uuid;
for (uuid = driver->uuids; *uuid; uuid++) {
- GSList *match = g_slist_find_custom(uuids, *uuid,
- (GCompareFunc) strcasecmp);
+ sdp_record_t *rec;
- if (!match)
+ if (!g_slist_find_custom(uuids, *uuid,
+ (GCompareFunc) strcasecmp))
continue;
driver->remove(driver, device);
@@ -694,7 +694,10 @@ void device_remove_drivers(struct btd_device *device, GSList *uuids, sdp_list_t
g_free(driver_data);
- sdp_record_t *rec = get_record(recs, *uuid);
+ rec = get_record(recs, *uuid);
+ if (!rec)
+ continue;
+
delete_record(src, dst, rec->handle);
}
}