diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-08-22 22:20:09 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-22 22:20:09 +0400 |
commit | 4475a0a93f368e57d5306d4cbe9318e8c1c90c41 (patch) | |
tree | b4b7b23d8939d3e764bf54026ae42205dc6850be /net/bluetooth/af_bluetooth.c | |
parent | 16a9d06c753abc44f66f88e03bbecb3f1e45d71b (diff) | |
parent | 687beaa0d1d937c327e2f97b4b4fa6c23ca70624 (diff) | |
download | linux-4475a0a93f368e57d5306d4cbe9318e8c1c90c41.tar.xz |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth
Diffstat (limited to 'net/bluetooth/af_bluetooth.c')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 8add9b499912..117e0d161780 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c @@ -494,9 +494,8 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) BT_DBG("sk %p", sk); add_wait_queue(sk_sleep(sk), &wait); + set_current_state(TASK_INTERRUPTIBLE); while (sk->sk_state != state) { - set_current_state(TASK_INTERRUPTIBLE); - if (!timeo) { err = -EINPROGRESS; break; @@ -510,12 +509,13 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) release_sock(sk); timeo = schedule_timeout(timeo); lock_sock(sk); + set_current_state(TASK_INTERRUPTIBLE); err = sock_error(sk); if (err) break; } - set_current_state(TASK_RUNNING); + __set_current_state(TASK_RUNNING); remove_wait_queue(sk_sleep(sk), &wait); return err; } |