diff options
author | Benjamin LaHaise <benjamin.c.lahaise@intel.com> | 2005-12-14 08:22:19 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 22:10:44 +0100 |
commit | c1cbe4b7ad0bc4b1d98ea708a3fecb7362aa4088 (patch) | |
tree | 04ec26c728645dd1da2474b2b883a532b43811ad /net/bluetooth/sco.c | |
parent | [IPVS]: remove dead code (diff) | |
download | linux-c1cbe4b7ad0bc4b1d98ea708a3fecb7362aa4088.tar.xz linux-c1cbe4b7ad0bc4b1d98ea708a3fecb7362aa4088.zip |
[NET]: Avoid atomic xchg() for non-error case
It also looks like there were 2 places where the test on sk_err was
missing from the event wait logic (in sk_stream_wait_connect and
sk_stream_wait_memory), while the rest of the sock_error() users look
to be doing the right thing. This version of the patch fixes those,
and cleans up a few places that were testing ->sk_err directly.
Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 9cb00dc6c08c..648181430699 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -637,8 +637,9 @@ static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, BT_DBG("sock %p, sk %p", sock, sk); - if (sk->sk_err) - return sock_error(sk); + err = sock_error(sk); + if (err) + return err; if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; |