diff mbox series

Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP

Message ID 20220803172006.2951684-1-luiz.dentz@gmail.com
State New
Headers show
Series Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP | expand

Commit Message

Luiz Augusto von Dentz Aug. 3, 2022, 5:20 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/iso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org Aug. 4, 2022, 12:10 a.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  3 Aug 2022 10:20:06 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> [...]

Here is the summary with links:
  - Bluetooth: ISO: Fix iso_sock_getsockopt for BT_DEFER_SETUP
    https://git.kernel.org/bluetooth/bluetooth-next/c/8a3fd9bb4fac

You are awesome, thank you!
diff mbox series

Patch

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;
 		}