aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-08 05:22:28 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:42 -0400
commitd9fbd02be5c201c1659ee0d79c0820bb68d95c8c (patch)
treeb2f7aa9fa77a90c45e5e5eeda0d47e16ef452c4c /net/bluetooth/l2cap_core.c
parent0775899158d0e1436316f3bf451d78bf34b88d17 (diff)
Bluetooth: Use explicit header and body length for L2CAP SKB allocation
When allocating the L2CAP SKB for transmission, provide the upper layers with a clear distinction on what is the header and what is the body portion of the SKB. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3dca28246cbe..ac2461442f21 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2131,7 +2131,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
2131 2131
2132 count = min_t(unsigned int, conn->mtu, len); 2132 count = min_t(unsigned int, conn->mtu, len);
2133 2133
2134 tmp = chan->ops->alloc_skb(chan, count, 2134 tmp = chan->ops->alloc_skb(chan, 0, count,
2135 msg->msg_flags & MSG_DONTWAIT); 2135 msg->msg_flags & MSG_DONTWAIT);
2136 if (IS_ERR(tmp)) 2136 if (IS_ERR(tmp))
2137 return PTR_ERR(tmp); 2137 return PTR_ERR(tmp);
@@ -2166,7 +2166,7 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
2166 2166
2167 count = min_t(unsigned int, (conn->mtu - hlen), len); 2167 count = min_t(unsigned int, (conn->mtu - hlen), len);
2168 2168
2169 skb = chan->ops->alloc_skb(chan, count + hlen, 2169 skb = chan->ops->alloc_skb(chan, hlen, count,
2170 msg->msg_flags & MSG_DONTWAIT); 2170 msg->msg_flags & MSG_DONTWAIT);
2171 if (IS_ERR(skb)) 2171 if (IS_ERR(skb))
2172 return skb; 2172 return skb;
@@ -2197,7 +2197,7 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
2197 2197
2198 count = min_t(unsigned int, (conn->mtu - L2CAP_HDR_SIZE), len); 2198 count = min_t(unsigned int, (conn->mtu - L2CAP_HDR_SIZE), len);
2199 2199
2200 skb = chan->ops->alloc_skb(chan, count + L2CAP_HDR_SIZE, 2200 skb = chan->ops->alloc_skb(chan, L2CAP_HDR_SIZE, count,
2201 msg->msg_flags & MSG_DONTWAIT); 2201 msg->msg_flags & MSG_DONTWAIT);
2202 if (IS_ERR(skb)) 2202 if (IS_ERR(skb))
2203 return skb; 2203 return skb;
@@ -2239,7 +2239,7 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
2239 2239
2240 count = min_t(unsigned int, (conn->mtu - hlen), len); 2240 count = min_t(unsigned int, (conn->mtu - hlen), len);
2241 2241
2242 skb = chan->ops->alloc_skb(chan, count + hlen, 2242 skb = chan->ops->alloc_skb(chan, hlen, count,
2243 msg->msg_flags & MSG_DONTWAIT); 2243 msg->msg_flags & MSG_DONTWAIT);
2244 if (IS_ERR(skb)) 2244 if (IS_ERR(skb))
2245 return skb; 2245 return skb;
@@ -2360,7 +2360,7 @@ static struct sk_buff *l2cap_create_le_flowctl_pdu(struct l2cap_chan *chan,
2360 2360
2361 count = min_t(unsigned int, (conn->mtu - hlen), len); 2361 count = min_t(unsigned int, (conn->mtu - hlen), len);
2362 2362
2363 skb = chan->ops->alloc_skb(chan, count + hlen, 2363 skb = chan->ops->alloc_skb(chan, hlen, count,
2364 msg->msg_flags & MSG_DONTWAIT); 2364 msg->msg_flags & MSG_DONTWAIT);
2365 if (IS_ERR(skb)) 2365 if (IS_ERR(skb))
2366 return skb; 2366 return skb;