Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Gavin Li and committed by
Marcel Holtmann
da891217 1f667e15

+3 -3
+1 -1
include/net/bluetooth/bluetooth.h
··· 345 345 __poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); 346 346 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 347 347 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); 348 - int bt_sock_wait_ready(struct sock *sk, unsigned long flags); 348 + int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags); 349 349 350 350 void bt_accept_enqueue(struct sock *parent, struct sock *sk, bool bh); 351 351 void bt_accept_unlink(struct sock *sk);
+2 -2
net/bluetooth/af_bluetooth.c
··· 568 568 EXPORT_SYMBOL(bt_sock_wait_state); 569 569 570 570 /* This function expects the sk lock to be held when called */ 571 - int bt_sock_wait_ready(struct sock *sk, unsigned long flags) 571 + int bt_sock_wait_ready(struct sock *sk, unsigned int msg_flags) 572 572 { 573 573 DECLARE_WAITQUEUE(wait, current); 574 574 unsigned long timeo; ··· 576 576 577 577 BT_DBG("sk %p", sk); 578 578 579 - timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); 579 + timeo = sock_sndtimeo(sk, !!(msg_flags & MSG_DONTWAIT)); 580 580 581 581 add_wait_queue(sk_sleep(sk), &wait); 582 582 set_current_state(TASK_INTERRUPTIBLE);