From: Luiz Augusto von Dentz Date: Wed, 3 Aug 2022 17:17:17 +0000 (-0700) Subject: Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP X-Git-Tag: v6.1-rc5~618^2~34^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dfe1727b21927c6dd8d703e3a9618b505eb6224;p=platform%2Fkernel%2Flinux-starfive.git Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP BT_DEFER_SETUP shall be considered valid for all states except for BT_CONNECTED as it is also used when initiated a connection rather then only for BT_BOUND and BT_LISTEN. Fixes: ccf74f2390d60 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Luiz Augusto von Dentz --- diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 70c2dd30cb13..015d1b41bc32 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -1251,7 +1251,7 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname, switch (optname) { case BT_DEFER_SETUP: - if (sk->sk_state != BT_BOUND && sk->sk_state != BT_LISTEN) { + if (sk->sk_state == BT_CONNECTED) { err = -EINVAL; break; }