diff options
author | David S. Miller <davem@davemloft.net> | 2010-10-07 03:59:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-07 03:59:39 -0400 |
commit | fb3dbece264a50ab4373f3af0bbbd9175d3ad4d7 (patch) | |
tree | 7208ecc94dcec12738635c5850980ce6d9f7349c /include | |
parent | 12e94471b2be5ef9b55b10004a3a2cd819490036 (diff) | |
parent | eaa71b318c5ed0cd1ac3182a533471dc5edf372d (diff) |
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.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 | |||
161 | { | 161 | { |
162 | struct sk_buff *skb; | 162 | struct sk_buff *skb; |
163 | 163 | ||
164 | release_sock(sk); | ||
164 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 165 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { |
165 | skb_reserve(skb, BT_SKB_RESERVE); | 166 | skb_reserve(skb, BT_SKB_RESERVE); |
166 | bt_cb(skb)->incoming = 0; | 167 | bt_cb(skb)->incoming = 0; |
167 | } | 168 | } |
169 | lock_sock(sk); | ||
170 | |||
171 | if (!skb && *err) | ||
172 | return NULL; | ||
173 | |||
174 | *err = sock_error(sk); | ||
175 | if (*err) | ||
176 | goto out; | ||
177 | |||
178 | if (sk->sk_shutdown) { | ||
179 | *err = -ECONNRESET; | ||
180 | goto out; | ||
181 | } | ||
168 | 182 | ||
169 | return skb; | 183 | return skb; |
184 | |||
185 | out: | ||
186 | kfree_skb(skb); | ||
187 | return NULL; | ||
170 | } | 188 | } |
171 | 189 | ||
172 | int bt_err(__u16 code); | 190 | int bt_err(__u16 code); |