summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-10-07 00:59:39 -0700
committerDavid S. Miller <davem@davemloft.net>2010-10-07 00:59:39 -0700
commitfb3dbece264a50ab4373f3af0bbbd9175d3ad4d7 (patch)
tree7208ecc94dcec12738635c5850980ce6d9f7349c /include
parent12e94471b2be5ef9b55b10004a3a2cd819490036 (diff)
parenteaa71b318c5ed0cd1ac3182a533471dc5edf372d (diff)
downloadop-kernel-dev-fb3dbece264a50ab4373f3af0bbbd9175d3ad4d7.zip
op-kernel-dev-fb3dbece264a50ab4373f3af0bbbd9175d3ad4d7.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/bluetooth.h18
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);
OpenPOWER on IntegriCloud