summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm
diff options
context:
space:
mode:
authorMat Martineau <mathewm@codeaurora.org>2011-07-22 14:53:58 -0700
committerGustavo F. Padovan <gustavo@padovan.org>2011-09-27 18:15:55 -0300
commit449357200c5d73d80a9c42dee5dafed684b3cd17 (patch)
tree333e387c99dc8cd03d334e61f1a5147b4e5bd8f9 /net/bluetooth/rfcomm
parent9fd481e03c1e9c76c814b88b9ea1cbda9afb0812 (diff)
downloadop-kernel-dev-449357200c5d73d80a9c42dee5dafed684b3cd17.zip
op-kernel-dev-449357200c5d73d80a9c42dee5dafed684b3cd17.tar.gz
Bluetooth: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM
Fragmented skbs are only encountered when receiving ERTM or streaming mode L2CAP data. BNEP, CMTP, HIDP, and RFCOMM generally use basic mode, but they need to handle fragments without crashing. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r--net/bluetooth/rfcomm/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 5ba3f6d..38b618c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1853,7 +1853,10 @@ static inline void rfcomm_process_rx(struct rfcomm_session *s)
/* Get data directly from socket receive queue without copying it. */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
skb_orphan(skb);
- rfcomm_recv_frame(s, skb);
+ if (!skb_linearize(skb))
+ rfcomm_recv_frame(s, skb);
+ else
+ kfree_skb(skb);
}
if (sk->sk_state == BT_CLOSED) {
OpenPOWER on IntegriCloud