Skip to content

Commit

Permalink
Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP
Browse files Browse the repository at this point in the history
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: ccf74f2 ("Bluetooth: Add BTPROTO_ISO socket type")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Luiz Augusto von Dentz committed Aug 9, 2022
1 parent 0c79375 commit 9dfe172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9dfe172

Please sign in to comment.