Skip to contentSkip to conversation

Fix closing stream of locked sep when reconfiguring

PATCH In review Luiz Augusto von Dentz 2 participants 2 messages Sep 8, 2010 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Fix closing stream of locked sep when reconfiguring

From: Luiz Augusto von Dentz <[email protected]>

Stream should only be closed if sep is unlocked otherwise there is a possibility that sep reconfiguration is triggered although the sep is in use by the user application.

---
 audio/a2dp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
audio/a2dp.c +2 -0
index b062aed..ef0df17 100644
@@ -1393,6 +1393,8 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
 		}
 
 		if (l != NULL) {
+			if (a2dp_sep_get_lock(tmp))
+				goto failed;
 			setup->reconfigure = TRUE;
 			if (avdtp_close(session, tmp->stream, FALSE) < 0) {
 				error("avdtp_close failed");
Signature · 1 line
1.7.0.4
#1 lore raw

Hi Luiz,

Quoted 14 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Stream should only be closed if sep is unlocked otherwise there is a possibility that sep reconfiguration is triggered although the sep is in use by the user application.

---
 audio/a2dp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
audio/a2dp.c +0 -0
index b062aed..ef0df17 100644

audio/a2dp.c unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep, · line 1400

Quoted 8 lines
audio/a2dp.c +2 -0
@@ -1393,6 +1393,8 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
 		}
 
 		if (l != NULL) {
+			if (a2dp_sep_get_lock(tmp))
+				goto failed;
 			setup->reconfigure = TRUE;
 			if (avdtp_close(session, tmp->stream, FALSE) < 0) {
 				error("avdtp_close failed");

Thanks for the patch! It's now in the upstream tree.

Johan