From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> If the session is not connected it makes no sense to enable the disconnect timer. --- profiles/audio/avdtp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 52ee767..78e7b4d 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -1171,7 +1171,12 @@ void avdtp_unref(struct avdtp *session) if (session->ref > 0) return; - set_disconnect_timer(session); + if (session->state == AVDTP_SESSION_STATE_CONNECTED) { + set_disconnect_timer(session); + return; + } + + connection_lost(session, ECONNABORTED); } struct avdtp *avdtp_ref(struct avdtp *session) -- 2.5.0 -- 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