[PATCH ] profiles/audio: Fix bluetoothd crash in a2dp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Checks for NULL session before calling avdtp_get_device, as
setup->session will be NULL if configuraion was aborted.
---
 profiles/audio/a2dp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index c9dac9a..810d1e6 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,10 @@ static gboolean auto_config(gpointer data)
 	if (setup->err != NULL)
 		goto done;
 
+	/* session will be NULL if configuration was aborted */
+	if (setup->session)
+		dev = avdtp_get_device(setup->session);
+
 	avdtp_stream_add_cb(setup->session, setup->stream,
 				stream_state_changed, setup->sep);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux