From: Mathias Krause Date: Thu, 7 Nov 2013 13:18:25 +0000 (+0100) Subject: caif: use pskb_put() instead of reimplementing its functionality X-Git-Tag: accepted/tizen/common/20141203.182822~1141^2~25^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=253c6daa343104c1278facd11cb5ecfc7554fb38;p=platform%2Fkernel%2Flinux-arm64.git 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 Cc: Dmitry Tarnyagin Cc: "David S. Miller" Signed-off-by: David S. Miller --- diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c index 6493351..1be0b52 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;