aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
203 PKT_ERROR(pkt, "cow failed\n"); 203 PKT_ERROR(pkt, "cow failed\n");
204 return -EPROTO; 204 return -EPROTO;
205 } 205 }
206 /*
207 * Is the SKB non-linear after skb_cow_data()? If so, we are
208 * going to add data to the last SKB, so we need to adjust
209 * lengths of the top SKB.
210 */
211 if (lastskb != skb) {
212 pr_warn("Packet is non-linear\n");
213 skb->len += len;
214 skb->data_len += len;
215 }
216 } 206 }
217 207
218 /* All set to put the last SKB and optionally write data there. */ 208 /* All set to put the last SKB and optionally write data there. */
219 to = skb_put(lastskb, len); 209 to = pskb_put(skb, lastskb, len);
220 if (likely(data)) 210 if (likely(data))
221 memcpy(to, data, len); 211 memcpy(to, data, len);
222 return 0; 212 return 0;