From 9b4bfa74d25e360932402994a32305bf2145eb34 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 30 Jul 2008 18:02:48 -0300 Subject: Fix adapter removal. --- src/device.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/device.c') 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); } } -- cgit