diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 91b1e4b..f42f21b 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
{
struct seid_req req;
int ret;
+ struct avdtp_local_sep *sep = stream->lsep;
if (!stream && session->discover) {
/* Don't call cb since it being aborted */
if (stream->lsep->state == AVDTP_STATE_ABORTING)
return -EINVAL;
+ avdtp_sep_set_state(session, sep, AVDTP_STATE_ABORTING);
+
if (session->req && stream == session->req->stream)
return cancel_request(session, ECANCELED);
diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 9664405..7c5e775 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
avdtp_stream_remove_cb(sink->session, sink->stream,
sink->cb_id);
- if (sink->session)
+ if (sink->session) {
avdtp_unref(sink->session);
+ sink->session = NULL;
+ }
if (sink->connect_id > 0) {
btd_service_connecting_complete(sink->service, -ECANCELED);