From 352a65d3de4fdf6e1e507f958685097f33e3b899 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 7 Oct 2008 11:30:19 +0200 Subject: Fix removing of entries from a GSList --- src/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/device.c b/src/device.c index 97b289ee..e0dfc0a0 100644 --- a/src/device.c +++ b/src/device.c @@ -679,7 +679,7 @@ void device_probe_drivers(struct btd_device *device, GSList *uuids, sdp_list_t * void device_remove_drivers(struct btd_device *device, GSList *uuids, sdp_list_t *recs) { struct btd_adapter *adapter = device_get_adapter(device); - GSList *list; + GSList *list, *next; char srcaddr[18], dstaddr[18]; bdaddr_t src; @@ -689,11 +689,13 @@ void device_remove_drivers(struct btd_device *device, GSList *uuids, sdp_list_t debug("Remove drivers for %s", device->path); - for (list = device->drivers; list; list = list->next) { + for (list = device->drivers; list; list = next) { struct btd_driver_data *driver_data = list->data; struct btd_device_driver *driver = driver_data->driver; const char **uuid; + next = list->next; + for (uuid = driver->uuids; *uuid; uuid++) { sdp_record_t *rec; -- cgit