From: Arkadiusz Bokowy Date: Sat, 5 Oct 2024 21:15:10 +0000 (+0200) Subject: avdtp: Fix state check before sending delay report X-Git-Tag: accepted/tizen/unified/20250221.111447~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c31f6e0c202854a57c34c7c8708e5a2c63b6634;p=platform%2Fupstream%2Fbluez.git 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. Signed-off-by: Anuj Jain --- diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index e920f3d5..91025ec6 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -4310,11 +4310,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;