diff options
author | David S. Miller <davem@davemloft.net> | 2010-10-11 12:30:34 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-11 12:30:34 -0700 |
commit | d122179a3c0fdc71b88cb9e3605f372b1651a9ff (patch) | |
tree | 63a48b333e7565967b6d7c9e246557bfcb9f225f /include | |
parent | 419c20465d6319274e7286f0966e2390540e6e0a (diff) | |
parent | b00916b189d13a615ff05c9242201135992fcda3 (diff) | |
download | blackbird-obmc-linux-d122179a3c0fdc71b88cb9e3605f372b1651a9ff.tar.gz blackbird-obmc-linux-d122179a3c0fdc71b88cb9e3605f372b1651a9ff.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/core/ethtool.c
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 27a902d9b3a9..30fce0128dd7 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -161,12 +161,30 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long l { struct sk_buff *skb; + release_sock(sk); if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { skb_reserve(skb, BT_SKB_RESERVE); bt_cb(skb)->incoming = 0; } + lock_sock(sk); + + if (!skb && *err) + return NULL; + + *err = sock_error(sk); + if (*err) + goto out; + + if (sk->sk_shutdown) { + *err = -ECONNRESET; + goto out; + } return skb; + +out: + kfree_skb(skb); + return NULL; } int bt_err(__u16 code); |