Skip to contentSkip to conversation

android/AVDTP: Fix not removing start_timer source

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Dec 18, 2013 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 android/AVDTP: Fix not removing start_timer source

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

It is possible that stream->start_timer can be set on stream_free which should then should take care of remove it properly otherwise it can trigger which would very likely cause a crash.

Thanks to Hannu Mallat <[email protected]> for reporting it.

---
 android/avdtp.c | 3 +++
 1 file changed, 3 insertions(+)
android/avdtp.c +3 -0
index 5ae3afc..3a3380a 100644
@@ -670,6 +670,9 @@ static void stream_free(void *data)
 	if (stream->timer)
 		g_source_remove(stream->timer);
 
+	if (stream->start_timer > 0)
+		g_source_remove(stream->start_timer);
+
 	if (stream->io)
 		close_stream(stream);
 
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Luiz,

Quoted 8 lines · Luiz Augusto von Dentz

It is possible that stream->start_timer can be set on stream_free which should then should take care of remove it properly otherwise it can trigger which would very likely cause a crash.

Thanks to Hannu Mallat <[email protected]> for reporting it.

---
 android/avdtp.c | 3 +++
 1 file changed, 3 insertions(+)

Applied. Thanks.

Johan