From bd7d49d54aa3aa490ebdd67b3dd2317d29213d45 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Sat, 5 Oct 2024 23:15:10 +0200 Subject: [PATCH] avdtp: Fix state check before sending delay report The function which handles the incoming delay report command was fixed in 2fd62cd. However, the function which send such command was not updated. This commit fixes that. Also, indicate that the stream does not support delay reporting with an appropriate error code. --- profiles/audio/avdtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 0a923ac6c..448ee2730 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -3769,11 +3769,12 @@ int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream, return -EINVAL; if (stream->lsep->state != AVDTP_STATE_CONFIGURED && + stream->lsep->state != AVDTP_STATE_OPEN && stream->lsep->state != AVDTP_STATE_STREAMING) return -EINVAL; if (!stream->delay_reporting || session->version < 0x0103) - return -EINVAL; + return -ENOTSUP; stream->delay = delay; -- 2.47.3