diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 0e075f9..aabc5ce 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);
+ avdtp_sep_set_state(session, stream->lsep, AVDTP_STATE_ABORTING);
if (session->req && stream == session->req->stream)
return cancel_request(session, ECANCELED);