Merge tag 'omap-for-v3.16/l3-noc-signed' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / net / caif / cfpkt_skbuff.c
index 6493351f39c6192b20a7a31e94c9b0cbb5268747..1be0b521ac490143e60e3b2d5b02d7fd68c24087 100644 (file)
@@ -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;