Diff between 0a1d0e8968d4c41aecf8f50956fb19dd725c3c78 and 14750a2e48f40d550f9fe7b1891d82a413ceef21

Changed Files

File Additions Deletions Status
profiles/audio/a2dp.c +3 -1 modified

Full Patch

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index c9dac9a..6b72f99 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -379,7 +379,7 @@ static void stream_state_changed(struct avdtp_stream *stream,
 static gboolean auto_config(gpointer data)
 {
 	struct a2dp_setup *setup = data;
-	struct btd_device *dev = avdtp_get_device(setup->session);
+	struct btd_device *dev = NULL;
 	struct btd_service *service;
 
 	/* Check if configuration was aborted */
@@ -389,6 +389,8 @@ static gboolean auto_config(gpointer data)
 	if (setup->err != NULL)
 		goto done;
 
+	dev = avdtp_get_device(setup->session);
+
 	avdtp_stream_add_cb(setup->session, setup->stream,
 				stream_state_changed, setup->sep);