[PATCH BlueZ v2 2/2] a2dp: don't change setup sep when it is reconfiguring

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

 



If a2dp_resume/a2dp_suspend are called while setup is being
reconfigured, they make the reconfiguration use wrong SEP.  This occurs
if transport Acquire/Release are called while reconfiguration is waiting
for CLOSE_RSP.

Fix by failing a2dp_resume/suspend early without changing the setup, if
it is reconfiguring.

Such resume/suspend calls would in any case fail, because
avdtp_close(stream) has been done, so avdtp_suspend/resume would return
error.
---
 profiles/audio/a2dp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index d6c97e7bf..37332abca 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -3132,6 +3132,9 @@ unsigned int a2dp_resume(struct avdtp *session, struct a2dp_sep *sep,
 	cb_data->resume_cb = cb;
 	cb_data->user_data = user_data;
 
+	if (setup->reconfigure)
+		goto failed;
+
 	setup->sep = sep;
 	setup->stream = sep->stream;
 
@@ -3190,6 +3193,9 @@ unsigned int a2dp_suspend(struct avdtp *session, struct a2dp_sep *sep,
 	cb_data->suspend_cb = cb;
 	cb_data->user_data = user_data;
 
+	if (setup->reconfigure)
+		goto failed;
+
 	setup->sep = sep;
 	setup->stream = sep->stream;
 
-- 
2.47.0





[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