diff options
author | Gavin Li <gavin@matician.com> | 2022-03-14 23:42:52 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2022-03-18 17:12:08 +0100 |
commit | da8912176fb0ff9fd60e14fa653108d96422b896 (patch) | |
tree | 77a391739c2267fe7c9cd62eb90f15a7e4b60dbc /net/bluetooth/af_bluetooth.c | |
parent | Bluetooth: Don't assign twice the same value (diff) | |
download | linux-da8912176fb0ff9fd60e14fa653108d96422b896.tar.xz linux-da8912176fb0ff9fd60e14fa653108d96422b896.zip |
Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready()
Callers pass msg->msg_flags as flags, which contains MSG_DONTWAIT
instead of O_NONBLOCK.
Signed-off-by: Gavin Li <gavin@matician.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index ee319779781e..a0cb2e3da8d4 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -568,7 +568,7 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) EXPORT_SYMBOL(bt_sock_wait_state); /* This function expects the sk lock to be held when called */ -int bt_sock_wait_ready(struct sock *sk, unsigned long flags) +int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags) { DECLARE_WAITQUEUE(wait, current); unsigned long timeo; @@ -576,7 +576,7 @@ int bt_sock_wait_ready(struct sock *sk, unsigned long flags) BT_DBG("sk %p", sk); - timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); + timeo = sock_sndtimeo(sk, !!(msg_flags & MSG_DONTWAIT)); add_wait_queue(sk_sleep(sk), &wait); set_current_state(TASK_INTERRUPTIBLE); |