summaryrefslogtreecommitdiffstats
path: root/net/caif
diff options
context:
space:
mode:
authorMathias Krause <mathias.krause@secunet.com>2013-11-07 14:18:25 +0100
committerDavid S. Miller <davem@davemloft.net>2013-11-07 19:28:59 -0500
commit253c6daa343104c1278facd11cb5ecfc7554fb38 (patch)
tree97e4ff68f7c9e196f1cfbd16070f19f8f46fe4e0 /net/caif
parent0c7ddf36c29c3ce12f2d2931a357ccaa0861035a (diff)
downloadlinux-stable-253c6daa343104c1278facd11cb5ecfc7554fb38.tar.gz
linux-stable-253c6daa343104c1278facd11cb5ecfc7554fb38.tar.bz2
linux-stable-253c6daa343104c1278facd11cb5ecfc7554fb38.zip
caif: use pskb_put() instead of reimplementing its functionality
Also remove the warning for fragmented packets -- skb_cow_data() will linearize the buffer, removing all fragments. Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r--net/caif/cfpkt_skbuff.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c
index 6493351f39c6..1be0b521ac49 100644
--- a/net/caif/cfpkt_skbuff.c
+++ b/net/caif/cfpkt_skbuff.c
@@ -203,20 +203,10 @@ int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len)
PKT_ERROR(pkt, "cow failed\n");
return -EPROTO;
}
- /*
- * Is the SKB non-linear after skb_cow_data()? If so, we are
- * going to add data to the last SKB, so we need to adjust
- * lengths of the top SKB.
- */
- if (lastskb != skb) {
- pr_warn("Packet is non-linear\n");
- skb->len += len;
- skb->data_len += len;
- }
}
/* All set to put the last SKB and optionally write data there. */
- to = skb_put(lastskb, len);
+ to = pskb_put(skb, lastskb, len);
if (likely(data))
memcpy(to, data, len);
return 0;