avdtp: Fix state check before sending delay report
authorArkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Sat, 5 Oct 2024 21:15:10 +0000 (23:15 +0200)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 20 Feb 2025 07:43:23 +0000 (16:43 +0900)
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 <anuj01.jain@samsung.com>
profiles/audio/avdtp.c

index e920f3d579db346ec3ab3c97ff0f4c82c2e3fc54..91025ec6ccc77e1c082445afb9218eb1f231ac6f 100644 (file)
@@ -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;