diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-19 09:13:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-19 09:14:50 +0100 |
commit | fb9a90f7c674f3ddef6baf55cb1612dadd8ea752 (patch) | |
tree | f25cf2ce17449ba34cdfdfb948134eb3464e400e /include/net/bluetooth/bluetooth.h | |
parent | 2d7b8366ae4a9ec2183c30e432a4a9a495c82bcd (diff) | |
parent | 21c74a8ea8b47eb6c3c621e36578f6e27f65c5c7 (diff) | |
download | op-kernel-dev-fb9a90f7c674f3ddef6baf55cb1612dadd8ea752.zip op-kernel-dev-fb9a90f7c674f3ddef6baf55cb1612dadd8ea752.tar.gz |
Merge remote branch 'airlied/drm-core-next' into tmp
Diffstat (limited to 'include/net/bluetooth/bluetooth.h')
-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 27a902d..30fce01 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); |