summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-08-03 19:17:17 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-08-09 02:06:10 +0200
commit9dfe1727b21927c6dd8d703e3a9618b505eb6224 (patch)
treed29189f8fd6dcaadc11e1098812ce063d6f6c1f0
parentBluetooth: MGMT: Fixes build warnings with C=1 (diff)
downloadlinux-9dfe1727b21927c6dd8d703e3a9618b505eb6224.tar.xz
linux-9dfe1727b21927c6dd8d703e3a9618b505eb6224.zip
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 <luiz.von.dentz@intel.com>
-rw-r--r--net/bluetooth/iso.c2
1 files changed, 1 insertions, 1 deletions
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;
}