Message ID | 20201104133318.Bluez.v1.3.Ib69ea31cb69840b941b725a1d889473c5e6cac97@changeid (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [Bluez,v1,1/3] policy: add checks before connecting | expand |
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 4c39088b8f..16fa20bba7 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -2612,6 +2612,11 @@ static int send_req(struct avdtp *session, gboolean priority, if (session->state == AVDTP_SESSION_STATE_DISCONNECTED) { session->io = l2cap_connect(session); if (!session->io) { + /* Report disconnection anyways, as the other layers + * are using this state for cleanup. + */ + avdtp_set_state(session, + AVDTP_SESSION_STATE_DISCONNECTED); err = -EIO; goto failed; }