summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-07 11:30:19 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-07 11:30:19 +0200
commit352a65d3de4fdf6e1e507f958685097f33e3b899 (patch)
tree114f6bb1c27e3a6a36b701f2afdd22f98e4b46e8 /src/device.c
parentacd17f476e4aba09becc325d1562f6c8db5e24ec (diff)
Fix removing of entries from a GSList
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c6
1 files changed, 4 insertions, 2 deletions
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;