Diff between f1594be140f0955e9320a818b6c9bdc991dc84f3 and 3fef42da82fc271b6e2444f9ddf774543edf6d1d

Changed Files

File Additions Deletions Status
profiles/audio/avctp.c +8 -6 modified

Full Patch

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 843de82..d39bbab 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -369,7 +369,7 @@ static struct avctp_pdu_handler *find_handler(GSList *list, uint8_t opcode)
 	return NULL;
 }
 
-static void pending_destroy(void *data)
+static void pending_destroy(gpointer data, gpointer user_data)
 {
 	struct avctp_pending_req *req = data;
 
@@ -394,8 +394,10 @@ static void avctp_channel_destroy(struct avctp_channel *chan)
 		g_source_remove(chan->process_id);
 
 	g_free(chan->buffer);
-	g_queue_free_full(chan->queue, pending_destroy);
-	g_slist_free_full(chan->processed, pending_destroy);
+	g_queue_foreach(chan->queue, pending_destroy, NULL);
+	g_queue_free(chan->queue);
+	g_slist_foreach(chan->processed, pending_destroy, NULL);
+	g_slist_free(chan->processed);
 	g_slist_free_full(chan->handlers, g_free);
 	g_free(chan);
 }
@@ -539,7 +541,7 @@ static gboolean req_timeout(gpointer user_data)
 
 	p->timeout = 0;
 
-	pending_destroy(p);
+	pending_destroy(p, NULL);
 	chan->p = NULL;
 
 	if (chan->process_id == 0)
@@ -573,7 +575,7 @@ static gboolean process_queue(void *user_data)
 		if (p->process(p->data) == 0)
 			break;
 
-		pending_destroy(p);
+		pending_destroy(p, NULL);
 	}
 
 	if (p == NULL)
@@ -625,7 +627,7 @@ static void control_response(struct avctp_channel *control,
 			return;
 
 		control->processed = g_slist_remove(control->processed, p);
-		pending_destroy(p);
+		pending_destroy(p, NULL);
 
 		return;
 	}