diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:23 -0400 |
commit | d626f62b11e00c16e81e4308ab93d3f13551812a (patch) | |
tree | fac4af6ced853755e12fc709d55f0c2bec51265d | |
parent | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (diff) |
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
133 files changed, 321 insertions, 230 deletions
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c index 98d79142f32b..9fc02654f0f5 100644 --- a/arch/ia64/sn/kernel/xpnet.c +++ b/arch/ia64/sn/kernel/xpnet.c | |||
@@ -566,7 +566,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
566 | msg->version = XPNET_VERSION_EMBED; | 566 | msg->version = XPNET_VERSION_EMBED; |
567 | dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n", | 567 | dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n", |
568 | &msg->data, skb->data, (size_t) embedded_bytes); | 568 | &msg->data, skb->data, (size_t) embedded_bytes); |
569 | memcpy(&msg->data, skb->data, (size_t) embedded_bytes); | 569 | skb_copy_from_linear_data(skb, &msg->data, |
570 | (size_t)embedded_bytes); | ||
570 | } else { | 571 | } else { |
571 | msg->version = XPNET_VERSION; | 572 | msg->version = XPNET_VERSION; |
572 | } | 573 | } |
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index fc518d85543d..1b9493a16aca 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
@@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb) | |||
221 | hdr->vpi = htons(vcc->vpi); | 221 | hdr->vpi = htons(vcc->vpi); |
222 | hdr->vci = htons(vcc->vci); | 222 | hdr->vci = htons(vcc->vci); |
223 | hdr->length = htonl(skb->len); | 223 | hdr->length = htonl(skb->len); |
224 | memcpy(skb_put(new_skb,skb->len),skb->data,skb->len); | 224 | skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len); |
225 | if (vcc->pop) vcc->pop(vcc,skb); | 225 | if (vcc->pop) vcc->pop(vcc,skb); |
226 | else dev_kfree_skb(skb); | 226 | else dev_kfree_skb(skb); |
227 | out_vcc->push(out_vcc,new_skb); | 227 | out_vcc->push(out_vcc,new_skb); |
@@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) | |||
310 | goto done; | 310 | goto done; |
311 | } | 311 | } |
312 | __net_timestamp(new_skb); | 312 | __net_timestamp(new_skb); |
313 | memcpy(skb_put(new_skb,skb->len),skb->data,skb->len); | 313 | skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len); |
314 | out_vcc->push(out_vcc,new_skb); | 314 | out_vcc->push(out_vcc,new_skb); |
315 | atomic_inc(&vcc->stats->tx); | 315 | atomic_inc(&vcc->stats->tx); |
316 | atomic_inc(&out_vcc->stats->rx); | 316 | atomic_inc(&out_vcc->stats->rx); |
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 26f4b7033494..14ced85b3f54 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
@@ -2395,7 +2395,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2395 | skb->destructor = ns_lb_destructor; | 2395 | skb->destructor = ns_lb_destructor; |
2396 | #endif /* NS_USE_DESTRUCTORS */ | 2396 | #endif /* NS_USE_DESTRUCTORS */ |
2397 | skb_push(skb, NS_SMBUFSIZE); | 2397 | skb_push(skb, NS_SMBUFSIZE); |
2398 | memcpy(skb->data, sb->data, NS_SMBUFSIZE); | 2398 | skb_copy_from_linear_data(sb, skb->data, NS_SMBUFSIZE); |
2399 | skb_put(skb, len - NS_SMBUFSIZE); | 2399 | skb_put(skb, len - NS_SMBUFSIZE); |
2400 | ATM_SKB(skb)->vcc = vcc; | 2400 | ATM_SKB(skb)->vcc = vcc; |
2401 | __net_timestamp(skb); | 2401 | __net_timestamp(skb); |
@@ -2479,7 +2479,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2479 | { | 2479 | { |
2480 | /* Copy the small buffer to the huge buffer */ | 2480 | /* Copy the small buffer to the huge buffer */ |
2481 | sb = (struct sk_buff *) iov->iov_base; | 2481 | sb = (struct sk_buff *) iov->iov_base; |
2482 | memcpy(hb->data, sb->data, iov->iov_len); | 2482 | skb_copy_from_linear_data(sb, hb->data, iov->iov_len); |
2483 | skb_put(hb, iov->iov_len); | 2483 | skb_put(hb, iov->iov_len); |
2484 | remaining = len - iov->iov_len; | 2484 | remaining = len - iov->iov_len; |
2485 | iov++; | 2485 | iov++; |
@@ -2491,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe) | |||
2491 | { | 2491 | { |
2492 | lb = (struct sk_buff *) iov->iov_base; | 2492 | lb = (struct sk_buff *) iov->iov_base; |
2493 | tocopy = min_t(int, remaining, iov->iov_len); | 2493 | tocopy = min_t(int, remaining, iov->iov_len); |
2494 | memcpy(skb_tail_pointer(hb), lb->data, tocopy); | 2494 | skb_copy_from_linear_data(lb, skb_tail_pointer(hb), tocopy); |
2495 | skb_put(hb, tocopy); | 2495 | skb_put(hb, tocopy); |
2496 | iov++; | 2496 | iov++; |
2497 | remaining -= tocopy; | 2497 | remaining -= tocopy; |
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 4c766f36d884..b990805806af 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c | |||
@@ -527,7 +527,7 @@ static int bfusb_send_frame(struct sk_buff *skb) | |||
527 | buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size; | 527 | buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size; |
528 | 528 | ||
529 | memcpy(skb_put(nskb, 3), buf, 3); | 529 | memcpy(skb_put(nskb, 3), buf, 3); |
530 | memcpy(skb_put(nskb, size), skb->data + sent, size); | 530 | skb_copy_from_linear_data_offset(skb, sent, skb_put(nskb, size), size); |
531 | 531 | ||
532 | sent += size; | 532 | sent += size; |
533 | count -= size; | 533 | count -= size; |
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 9fca6513562d..e8ebd5d3de86 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -231,7 +231,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data) | |||
231 | cr = (struct usb_ctrlrequest *) urb->setup_packet; | 231 | cr = (struct usb_ctrlrequest *) urb->setup_packet; |
232 | cr->wLength = __cpu_to_le16(skb->len); | 232 | cr->wLength = __cpu_to_le16(skb->len); |
233 | 233 | ||
234 | memcpy(urb->transfer_buffer, skb->data, skb->len); | 234 | skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len); |
235 | urb->transfer_buffer_length = skb->len; | 235 | urb->transfer_buffer_length = skb->len; |
236 | 236 | ||
237 | err = usb_submit_urb(urb, GFP_ATOMIC); | 237 | err = usb_submit_urb(urb, GFP_ATOMIC); |
@@ -250,7 +250,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data) | |||
250 | skb = skb_dequeue(&data->tx_queue); | 250 | skb = skb_dequeue(&data->tx_queue); |
251 | 251 | ||
252 | if (skb) { | 252 | if (skb) { |
253 | memcpy(urb->transfer_buffer, skb->data, skb->len); | 253 | skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len); |
254 | urb->transfer_buffer_length = skb->len; | 254 | urb->transfer_buffer_length = skb->len; |
255 | 255 | ||
256 | err = usb_submit_urb(urb, GFP_ATOMIC); | 256 | err = usb_submit_urb(urb, GFP_ATOMIC); |
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 459aa97937ab..7f9c54b9964a 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -425,7 +425,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb) | |||
425 | return -ENOMEM; | 425 | return -ENOMEM; |
426 | 426 | ||
427 | skb_reserve(s, NSHL); | 427 | skb_reserve(s, NSHL); |
428 | memcpy(skb_put(s, skb->len), skb->data, skb->len); | 428 | skb_copy_from_linear_data(skb, skb_put(s, skb->len), skb->len); |
429 | if (skb->len & 0x0001) | 429 | if (skb->len & 0x0001) |
430 | *skb_put(s, 1) = 0; /* PAD */ | 430 | *skb_put(s, 1) = 0; /* PAD */ |
431 | 431 | ||
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 8d025e9b5bce..157b1d09ab55 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -4169,7 +4169,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4169 | netif_stop_queue(dev); | 4169 | netif_stop_queue(dev); |
4170 | 4170 | ||
4171 | /* copy data to device buffers */ | 4171 | /* copy data to device buffers */ |
4172 | memcpy(info->tx_buf, skb->data, skb->len); | 4172 | skb_copy_from_linear_data(skb, info->tx_buf, skb->len); |
4173 | info->tx_get = 0; | 4173 | info->tx_get = 0; |
4174 | info->tx_put = info->tx_count = skb->len; | 4174 | info->tx_put = info->tx_count = skb->len; |
4175 | 4175 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index e842c65a3f4d..3b4b0acd707f 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -821,7 +821,8 @@ static void process_mpa_reply(struct iwch_ep *ep, struct sk_buff *skb) | |||
821 | /* | 821 | /* |
822 | * copy the new data into our accumulation buffer. | 822 | * copy the new data into our accumulation buffer. |
823 | */ | 823 | */ |
824 | memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len); | 824 | skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]), |
825 | skb->len); | ||
825 | ep->mpa_pkt_len += skb->len; | 826 | ep->mpa_pkt_len += skb->len; |
826 | 827 | ||
827 | /* | 828 | /* |
@@ -940,7 +941,8 @@ static void process_mpa_request(struct iwch_ep *ep, struct sk_buff *skb) | |||
940 | /* | 941 | /* |
941 | * Copy the new data into our accumulation buffer. | 942 | * Copy the new data into our accumulation buffer. |
942 | */ | 943 | */ |
943 | memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len); | 944 | skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]), |
945 | skb->len); | ||
944 | ep->mpa_pkt_len += skb->len; | 946 | ep->mpa_pkt_len += skb->len; |
945 | 947 | ||
946 | /* | 948 | /* |
@@ -1619,7 +1621,8 @@ static int terminate(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1619 | PDBG("%s ep %p\n", __FUNCTION__, ep); | 1621 | PDBG("%s ep %p\n", __FUNCTION__, ep); |
1620 | skb_pull(skb, sizeof(struct cpl_rdma_terminate)); | 1622 | skb_pull(skb, sizeof(struct cpl_rdma_terminate)); |
1621 | PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len); | 1623 | PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len); |
1622 | memcpy(ep->com.qp->attr.terminate_buffer, skb->data, skb->len); | 1624 | skb_copy_from_linear_data(skb, ep->com.qp->attr.terminate_buffer, |
1625 | skb->len); | ||
1623 | ep->com.qp->attr.terminate_msg_len = skb->len; | 1626 | ep->com.qp->attr.terminate_msg_len = skb->len; |
1624 | ep->com.qp->attr.is_terminate_local = 0; | 1627 | ep->com.qp->attr.is_terminate_local = 0; |
1625 | return CPL_RET_BUF_DONE; | 1628 | return CPL_RET_BUF_DONE; |
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index e3e5c1399076..ee2b0b9f8f46 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c | |||
@@ -442,7 +442,7 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb) | |||
442 | return 0; | 442 | return 0; |
443 | } | 443 | } |
444 | skb_reserve(xmit_skb, 19); | 444 | skb_reserve(xmit_skb, 19); |
445 | memcpy(skb_put(xmit_skb, len), skb->data, len); | 445 | skb_copy_from_linear_data(skb, skb_put(xmit_skb, len), len); |
446 | } else { | 446 | } else { |
447 | xmit_skb = skb_clone(skb, GFP_ATOMIC); | 447 | xmit_skb = skb_clone(skb, GFP_ATOMIC); |
448 | if (!xmit_skb) { | 448 | if (!xmit_skb) { |
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c index 2baef349c12d..c8e1c357cec8 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c | |||
@@ -652,7 +652,7 @@ static int write_modem(struct cardstate *cs) | |||
652 | * transmit data | 652 | * transmit data |
653 | */ | 653 | */ |
654 | count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size); | 654 | count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size); |
655 | memcpy(ucs->bulk_out_buffer, bcs->tx_skb->data, count); | 655 | skb_copy_from_linear_data(bcs->tx_skb, ucs->bulk_out_buffer, count); |
656 | skb_pull(bcs->tx_skb, count); | 656 | skb_pull(bcs->tx_skb, count); |
657 | atomic_set(&ucs->busy, 1); | 657 | atomic_set(&ucs->busy, 1); |
658 | gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count); | 658 | gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count); |
diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 1e2d38e3d68c..428872b653e9 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c | |||
@@ -404,7 +404,8 @@ static void b1dma_dispatch_tx(avmcard *card) | |||
404 | printk(KERN_DEBUG "tx: put 0x%x len=%d\n", | 404 | printk(KERN_DEBUG "tx: put 0x%x len=%d\n", |
405 | skb->data[2], txlen); | 405 | skb->data[2], txlen); |
406 | #endif | 406 | #endif |
407 | memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2); | 407 | skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf, |
408 | skb->len - 2); | ||
408 | } | 409 | } |
409 | txlen = (txlen + 3) & ~3; | 410 | txlen = (txlen + 3) & ~3; |
410 | 411 | ||
diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 6f5efa8d78cb..d58f927e766a 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c | |||
@@ -457,7 +457,8 @@ static void c4_dispatch_tx(avmcard *card) | |||
457 | printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n", | 457 | printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n", |
458 | card->name, skb->data[2], txlen); | 458 | card->name, skb->data[2], txlen); |
459 | #endif | 459 | #endif |
460 | memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2); | 460 | skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf, |
461 | skb->len - 2); | ||
461 | } | 462 | } |
462 | txlen = (txlen + 3) & ~3; | 463 | txlen = (txlen + 3) & ~3; |
463 | 464 | ||
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index ae377e812775..1642dca988a1 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c | |||
@@ -254,14 +254,16 @@ write_modem(struct BCState *bcs) { | |||
254 | count = len; | 254 | count = len; |
255 | if (count > MAX_MODEM_BUF - fp) { | 255 | if (count > MAX_MODEM_BUF - fp) { |
256 | count = MAX_MODEM_BUF - fp; | 256 | count = MAX_MODEM_BUF - fp; |
257 | memcpy(cs->hw.elsa.transbuf + fp, bcs->tx_skb->data, count); | 257 | skb_copy_from_linear_data(bcs->tx_skb, |
258 | cs->hw.elsa.transbuf + fp, count); | ||
258 | skb_pull(bcs->tx_skb, count); | 259 | skb_pull(bcs->tx_skb, count); |
259 | cs->hw.elsa.transcnt += count; | 260 | cs->hw.elsa.transcnt += count; |
260 | ret = count; | 261 | ret = count; |
261 | count = len - count; | 262 | count = len - count; |
262 | fp = 0; | 263 | fp = 0; |
263 | } | 264 | } |
264 | memcpy((cs->hw.elsa.transbuf + fp), bcs->tx_skb->data, count); | 265 | skb_copy_from_linear_data(bcs->tx_skb, |
266 | cs->hw.elsa.transbuf + fp, count); | ||
265 | skb_pull(bcs->tx_skb, count); | 267 | skb_pull(bcs->tx_skb, count); |
266 | cs->hw.elsa.transcnt += count; | 268 | cs->hw.elsa.transcnt += count; |
267 | ret += count; | 269 | ret += count; |
diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index cd3b5ad53491..3446f249d675 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c | |||
@@ -1293,7 +1293,8 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | |||
1293 | oskb = skb; | 1293 | oskb = skb; |
1294 | skb = alloc_skb(oskb->len + i, GFP_ATOMIC); | 1294 | skb = alloc_skb(oskb->len + i, GFP_ATOMIC); |
1295 | memcpy(skb_put(skb, i), header, i); | 1295 | memcpy(skb_put(skb, i), header, i); |
1296 | memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len); | 1296 | skb_copy_from_linear_data(oskb, |
1297 | skb_put(skb, oskb->len), oskb->len); | ||
1297 | dev_kfree_skb(oskb); | 1298 | dev_kfree_skb(oskb); |
1298 | } | 1299 | } |
1299 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); | 1300 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); |
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index b2ae4ec1e49e..4433ce0fca55 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c | |||
@@ -398,7 +398,7 @@ static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) | |||
398 | _len = CAPIMSG_LEN(skb->data); | 398 | _len = CAPIMSG_LEN(skb->data); |
399 | if (_len > 22) { | 399 | if (_len > 22) { |
400 | _len2 = _len - 22; | 400 | _len2 = _len - 22; |
401 | memcpy(msghead, skb->data, 22); | 401 | skb_copy_from_linear_data(skb, msghead, 22); |
402 | memcpy(skb->data + _len2, msghead, 22); | 402 | memcpy(skb->data + _len2, msghead, 22); |
403 | skb_pull(skb, _len2); | 403 | skb_pull(skb, _len2); |
404 | CAPIMSG_SETLEN(skb->data, 22); | 404 | CAPIMSG_SETLEN(skb->data, 22); |
diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index b7b5aa4748a0..81db4a190d41 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c | |||
@@ -113,7 +113,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf, | |||
113 | (skb = hysdn_tx_netget(card)) != NULL) | 113 | (skb = hysdn_tx_netget(card)) != NULL) |
114 | { | 114 | { |
115 | if (skb->len <= maxlen) { | 115 | if (skb->len <= maxlen) { |
116 | memcpy(buf, skb->data, skb->len); /* copy the packet to the buffer */ | 116 | /* copy the packet to the buffer */ |
117 | skb_copy_from_linear_data(skb, buf, skb->len); | ||
117 | *len = skb->len; | 118 | *len = skb->len; |
118 | *chan = CHAN_NDIS_DATA; | 119 | *chan = CHAN_NDIS_DATA; |
119 | card->net_tx_busy = 1; /* we are busy sending network data */ | 120 | card->net_tx_busy = 1; /* we are busy sending network data */ |
@@ -126,7 +127,7 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf, | |||
126 | ((skb = hycapi_tx_capiget(card)) != NULL) ) | 127 | ((skb = hycapi_tx_capiget(card)) != NULL) ) |
127 | { | 128 | { |
128 | if (skb->len <= maxlen) { | 129 | if (skb->len <= maxlen) { |
129 | memcpy(buf, skb->data, skb->len); | 130 | skb_copy_from_linear_data(skb, buf, skb->len); |
130 | *len = skb->len; | 131 | *len = skb->len; |
131 | *chan = CHAN_CAPI; | 132 | *chan = CHAN_CAPI; |
132 | hycapi_tx_capiack(card); | 133 | hycapi_tx_capiack(card); |
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 9c926e41b114..c97330b19877 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -829,7 +829,7 @@ isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, wait_que | |||
829 | dflag = 0; | 829 | dflag = 0; |
830 | } | 830 | } |
831 | count_put = count_pull; | 831 | count_put = count_pull; |
832 | memcpy(cp, skb->data, count_put); | 832 | skb_copy_from_linear_data(skb, cp, count_put); |
833 | cp += count_put; | 833 | cp += count_put; |
834 | len -= count_put; | 834 | len -= count_put; |
835 | #ifdef CONFIG_ISDN_AUDIO | 835 | #ifdef CONFIG_ISDN_AUDIO |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index be915051cb2e..387392cb3d68 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -1100,7 +1100,8 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff | |||
1100 | goto drop_packet; | 1100 | goto drop_packet; |
1101 | } | 1101 | } |
1102 | skb_put(skb, skb_old->len + 128); | 1102 | skb_put(skb, skb_old->len + 128); |
1103 | memcpy(skb->data, skb_old->data, skb_old->len); | 1103 | skb_copy_from_linear_data(skb_old, skb->data, |
1104 | skb_old->len); | ||
1104 | if (net_dev->local->ppp_slot < 0) { | 1105 | if (net_dev->local->ppp_slot < 0) { |
1105 | printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n", | 1106 | printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n", |
1106 | __FUNCTION__, net_dev->local->ppp_slot); | 1107 | __FUNCTION__, net_dev->local->ppp_slot); |
@@ -1902,7 +1903,9 @@ void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp, | |||
1902 | while( from != to ) { | 1903 | while( from != to ) { |
1903 | unsigned int len = from->len - MP_HEADER_LEN; | 1904 | unsigned int len = from->len - MP_HEADER_LEN; |
1904 | 1905 | ||
1905 | memcpy(skb_put(skb,len), from->data+MP_HEADER_LEN, len); | 1906 | skb_copy_from_linear_data_offset(from, MP_HEADER_LEN, |
1907 | skb_put(skb,len), | ||
1908 | len); | ||
1906 | frag = from->next; | 1909 | frag = from->next; |
1907 | isdn_ppp_mp_free_skb(mp, from); | 1910 | isdn_ppp_mp_free_skb(mp, from); |
1908 | from = frag; | 1911 | from = frag; |
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index e3add27dd0e1..e93ad59f60bf 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c | |||
@@ -415,7 +415,8 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card) | |||
415 | spin_lock_irqsave(&card->isdnloop_lock, flags); | 415 | spin_lock_irqsave(&card->isdnloop_lock, flags); |
416 | nskb = dev_alloc_skb(skb->len); | 416 | nskb = dev_alloc_skb(skb->len); |
417 | if (nskb) { | 417 | if (nskb) { |
418 | memcpy(skb_put(nskb, len), skb->data, len); | 418 | skb_copy_from_linear_data(skb, |
419 | skb_put(nskb, len), len); | ||
419 | skb_queue_tail(&card->bqueue[channel], nskb); | 420 | skb_queue_tail(&card->bqueue[channel], nskb); |
420 | dev_kfree_skb(skb); | 421 | dev_kfree_skb(skb); |
421 | } else | 422 | } else |
diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c index 47c59e95898d..7b55e151f1b0 100644 --- a/drivers/isdn/pcbit/capi.c +++ b/drivers/isdn/pcbit/capi.c | |||
@@ -429,8 +429,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, | |||
429 | if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC))) | 429 | if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC))) |
430 | return -1; | 430 | return -1; |
431 | 431 | ||
432 | memcpy(info->data.setup.CallingPN, skb->data + count + 1, | 432 | skb_copy_from_linear_data_offset(skb, count + 1, |
433 | len - count); | 433 | info->data.setup.CallingPN, |
434 | len - count); | ||
434 | info->data.setup.CallingPN[len - count] = 0; | 435 | info->data.setup.CallingPN[len - count] = 0; |
435 | 436 | ||
436 | } | 437 | } |
@@ -457,8 +458,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan, | |||
457 | if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC))) | 458 | if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC))) |
458 | return -1; | 459 | return -1; |
459 | 460 | ||
460 | memcpy(info->data.setup.CalledPN, skb->data + count + 1, | 461 | skb_copy_from_linear_data_offset(skb, count + 1, |
461 | len - count); | 462 | info->data.setup.CalledPN, |
463 | len - count); | ||
462 | info->data.setup.CalledPN[len - count] = 0; | 464 | info->data.setup.CalledPN[len - count] = 0; |
463 | 465 | ||
464 | } | 466 | } |
@@ -539,7 +541,7 @@ int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb) | |||
539 | 541 | ||
540 | #ifdef DEBUG | 542 | #ifdef DEBUG |
541 | if (len > 1 && len < 31) { | 543 | if (len > 1 && len < 31) { |
542 | memcpy(str, skb->data + 2, len - 1); | 544 | skb_copy_from_linear_data_offset(skb, 2, str, len - 1); |
543 | str[len] = 0; | 545 | str[len] = 0; |
544 | printk(KERN_DEBUG "Connected Party Number: %s\n", str); | 546 | printk(KERN_DEBUG "Connected Party Number: %s\n", str); |
545 | } | 547 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index 9de177a5b9f1..6a5ab409c4e7 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -697,7 +697,9 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
697 | } | 697 | } |
698 | else | 698 | else |
699 | { | 699 | { |
700 | memcpy(dest_addr, priv->ule_skb->data, ETH_ALEN); | 700 | skb_copy_from_linear_data(priv->ule_skb, |
701 | dest_addr, | ||
702 | ETH_ALEN); | ||
701 | skb_pull(priv->ule_skb, ETH_ALEN); | 703 | skb_pull(priv->ule_skb, ETH_ALEN); |
702 | } | 704 | } |
703 | } | 705 | } |
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index 21fe1b66808c..7dd34bd28efc 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
@@ -932,7 +932,7 @@ mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg) | |||
932 | pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, | 932 | pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, |
933 | priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); | 933 | priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); |
934 | 934 | ||
935 | memcpy(skb_put(skb, len), old_skb->data, len); | 935 | skb_copy_from_linear_data(old_skb, skb_put(skb, len), len); |
936 | 936 | ||
937 | pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, | 937 | pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, |
938 | priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); | 938 | priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); |
@@ -1093,7 +1093,7 @@ mpt_lan_receive_post_reply(struct net_device *dev, | |||
1093 | priv->RcvCtl[ctx].dma, | 1093 | priv->RcvCtl[ctx].dma, |
1094 | priv->RcvCtl[ctx].len, | 1094 | priv->RcvCtl[ctx].len, |
1095 | PCI_DMA_FROMDEVICE); | 1095 | PCI_DMA_FROMDEVICE); |
1096 | memcpy(skb_put(skb, l), old_skb->data, l); | 1096 | skb_copy_from_linear_data(old_skb, skb_put(skb, l), l); |
1097 | 1097 | ||
1098 | pci_dma_sync_single_for_device(mpt_dev->pcidev, | 1098 | pci_dma_sync_single_for_device(mpt_dev->pcidev, |
1099 | priv->RcvCtl[ctx].dma, | 1099 | priv->RcvCtl[ctx].dma, |
@@ -1122,7 +1122,7 @@ mpt_lan_receive_post_reply(struct net_device *dev, | |||
1122 | priv->RcvCtl[ctx].len, | 1122 | priv->RcvCtl[ctx].len, |
1123 | PCI_DMA_FROMDEVICE); | 1123 | PCI_DMA_FROMDEVICE); |
1124 | 1124 | ||
1125 | memcpy(skb_put(skb, len), old_skb->data, len); | 1125 | skb_copy_from_linear_data(old_skb, skb_put(skb, len), len); |
1126 | 1126 | ||
1127 | pci_dma_sync_single_for_device(mpt_dev->pcidev, | 1127 | pci_dma_sync_single_for_device(mpt_dev->pcidev, |
1128 | priv->RcvCtl[ctx].dma, | 1128 | priv->RcvCtl[ctx].dma, |
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index c693b5a79500..e985a85a5623 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c | |||
@@ -1025,7 +1025,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb) | |||
1025 | adapter->current_dma.start_time = jiffies; | 1025 | adapter->current_dma.start_time = jiffies; |
1026 | 1026 | ||
1027 | if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) { | 1027 | if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) { |
1028 | memcpy(adapter->dma_buffer, skb->data, nlen); | 1028 | skb_copy_from_linear_data(skb, adapter->dma_buffer, nlen); |
1029 | memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len); | 1029 | memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len); |
1030 | target = isa_virt_to_bus(adapter->dma_buffer); | 1030 | target = isa_virt_to_bus(adapter->dma_buffer); |
1031 | } | 1031 | } |
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 6b2036df6856..a384f7d478ab 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -1145,7 +1145,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1145 | 1145 | ||
1146 | if (len != skb->len) | 1146 | if (len != skb->len) |
1147 | memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); | 1147 | memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); |
1148 | memcpy((char *) p->xmit_cbuffs[p->xmit_count], (char *) (skb->data), skb->len); | 1148 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1149 | 1149 | ||
1150 | #if (NUM_XMIT_BUFFS == 1) | 1150 | #if (NUM_XMIT_BUFFS == 1) |
1151 | #ifdef NO_NOPCOMMANDS | 1151 | #ifdef NO_NOPCOMMANDS |
diff --git a/drivers/net/7990.c b/drivers/net/7990.c index c50264aea16b..d396f996af57 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c | |||
@@ -567,7 +567,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
567 | 567 | ||
568 | if (skb->len < ETH_ZLEN) | 568 | if (skb->len < ETH_ZLEN) |
569 | memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN); | 569 | memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN); |
570 | memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 570 | skb_copy_from_linear_data(skb, &ib->tx_buf[entry][0], skblen); |
571 | 571 | ||
572 | /* Now, give the packet to the lance */ | 572 | /* Now, give the packet to the lance */ |
573 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); | 573 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); |
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index b38fc65005eb..1226cbba0450 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -598,7 +598,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
598 | ib->btx_ring [entry].length = (-len) | 0xf000; | 598 | ib->btx_ring [entry].length = (-len) | 0xf000; |
599 | ib->btx_ring [entry].misc = 0; | 599 | ib->btx_ring [entry].misc = 0; |
600 | 600 | ||
601 | memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 601 | skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen); |
602 | 602 | ||
603 | /* Clear the slack of the packet, do I need this? */ | 603 | /* Clear the slack of the packet, do I need this? */ |
604 | if (len != skblen) | 604 | if (len != skblen) |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index f6a87bd20ff2..cc4610db6395 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -273,7 +273,8 @@ static int ack_tx(struct net_device *dev, int acked) | |||
273 | /* skb_pull(ackskb, ARC_HDR_SIZE); */ | 273 | /* skb_pull(ackskb, ARC_HDR_SIZE); */ |
274 | 274 | ||
275 | 275 | ||
276 | memcpy(ackpkt, lp->outgoing.skb->data, ARC_HDR_SIZE+sizeof(struct arc_cap)); | 276 | skb_copy_from_linear_data(lp->outgoing.skb, ackpkt, |
277 | ARC_HDR_SIZE + sizeof(struct arc_cap)); | ||
277 | ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */ | 278 | ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */ |
278 | ackpkt->soft.cap.mes.ack=acked; | 279 | ackpkt->soft.cap.mes.ack=acked; |
279 | 280 | ||
diff --git a/drivers/net/atari_bionet.c b/drivers/net/atari_bionet.c index f52e7f22f63d..13dbed368d6a 100644 --- a/drivers/net/atari_bionet.c +++ b/drivers/net/atari_bionet.c | |||
@@ -453,7 +453,8 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) { | |||
453 | stdma_lock(bionet_intr, NULL); | 453 | stdma_lock(bionet_intr, NULL); |
454 | local_irq_restore(flags); | 454 | local_irq_restore(flags); |
455 | if( !STRAM_ADDR(buf+length-1) ) { | 455 | if( !STRAM_ADDR(buf+length-1) ) { |
456 | memcpy(nic_packet->buffer, skb->data, length); | 456 | skb_copy_from_linear_data(skb, nic_packet->buffer, |
457 | length); | ||
457 | buf = (unsigned long)&((struct nic_pkt_s *)phys_nic_packet)->buffer; | 458 | buf = (unsigned long)&((struct nic_pkt_s *)phys_nic_packet)->buffer; |
458 | } | 459 | } |
459 | 460 | ||
diff --git a/drivers/net/atari_pamsnet.c b/drivers/net/atari_pamsnet.c index 3b5436149286..745101d7451b 100644 --- a/drivers/net/atari_pamsnet.c +++ b/drivers/net/atari_pamsnet.c | |||
@@ -717,7 +717,8 @@ pamsnet_send_packet(struct sk_buff *skb, struct net_device *dev) { | |||
717 | 717 | ||
718 | local_irq_restore(flags); | 718 | local_irq_restore(flags); |
719 | if( !STRAM_ADDR(buf+length-1) ) { | 719 | if( !STRAM_ADDR(buf+length-1) ) { |
720 | memcpy(nic_packet->buffer, skb->data, length); | 720 | skb_copy_from_linear_data(skb, nic_packet->buffer, |
721 | length); | ||
721 | buf = (unsigned long)phys_nic_packet; | 722 | buf = (unsigned long)phys_nic_packet; |
722 | } | 723 | } |
723 | 724 | ||
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 97b55f2546c5..d10fb80e9a63 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -1125,7 +1125,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev) | |||
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | pDB = aup->tx_db_inuse[aup->tx_head]; | 1127 | pDB = aup->tx_db_inuse[aup->tx_head]; |
1128 | memcpy((void *)pDB->vaddr, skb->data, skb->len); | 1128 | skb_copy_from_linear_data(skb, pDB->vaddr, skb->len); |
1129 | if (skb->len < ETH_ZLEN) { | 1129 | if (skb->len < ETH_ZLEN) { |
1130 | for (i=skb->len; i<ETH_ZLEN; i++) { | 1130 | for (i=skb->len; i<ETH_ZLEN; i++) { |
1131 | ((char *)pDB->vaddr)[i] = 0; | 1131 | ((char *)pDB->vaddr)[i] = 0; |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index f67d97de97ff..879a2fff474e 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -828,8 +828,8 @@ static int b44_rx(struct b44 *bp, int budget) | |||
828 | skb_reserve(copy_skb, 2); | 828 | skb_reserve(copy_skb, 2); |
829 | skb_put(copy_skb, len); | 829 | skb_put(copy_skb, len); |
830 | /* DMA sync done above, copy just the actual packet */ | 830 | /* DMA sync done above, copy just the actual packet */ |
831 | memcpy(copy_skb->data, skb->data+bp->rx_offset, len); | 831 | skb_copy_from_linear_data_offset(skb, bp->rx_offset, |
832 | 832 | copy_skb->data, len); | |
833 | skb = copy_skb; | 833 | skb = copy_skb; |
834 | } | 834 | } |
835 | skb->ip_summed = CHECKSUM_NONE; | 835 | skb->ip_summed = CHECKSUM_NONE; |
@@ -1006,7 +1006,8 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1006 | goto err_out; | 1006 | goto err_out; |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | memcpy(skb_put(bounce_skb, len), skb->data, skb->len); | 1009 | skb_copy_from_linear_data(skb, skb_put(bounce_skb, len), |
1010 | skb->len); | ||
1010 | dev_kfree_skb_any(skb); | 1011 | dev_kfree_skb_any(skb); |
1011 | skb = bounce_skb; | 1012 | skb = bounce_skb; |
1012 | } | 1013 | } |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7e7b5f344030..f98a2205a090 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1884,10 +1884,8 @@ bnx2_rx_int(struct bnx2 *bp, int budget) | |||
1884 | goto reuse_rx; | 1884 | goto reuse_rx; |
1885 | 1885 | ||
1886 | /* aligned copy */ | 1886 | /* aligned copy */ |
1887 | memcpy(new_skb->data, | 1887 | skb_copy_from_linear_data_offset(skb, bp->rx_offset - 2, |
1888 | skb->data + bp->rx_offset - 2, | 1888 | new_skb->data, len + 2); |
1889 | len + 2); | ||
1890 | |||
1891 | skb_reserve(new_skb, 2); | 1889 | skb_reserve(new_skb, 2); |
1892 | skb_put(new_skb, len); | 1890 | skb_put(new_skb, len); |
1893 | 1891 | ||
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index bd3ab6493e39..4aec747d9e43 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -2846,8 +2846,8 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring, | |||
2846 | ctrl | TX_DESC_SOF, 0); | 2846 | ctrl | TX_DESC_SOF, 0); |
2847 | entry = TX_DESC_NEXT(ring, entry); | 2847 | entry = TX_DESC_NEXT(ring, entry); |
2848 | 2848 | ||
2849 | memcpy(tx_tiny_buf(cp, ring, entry), skb->data + | 2849 | skb_copy_from_linear_data_offset(skb, len - tabort, |
2850 | len - tabort, tabort); | 2850 | tx_tiny_buf(cp, ring, entry), tabort); |
2851 | mapping = tx_tiny_map(cp, ring, entry, tentry); | 2851 | mapping = tx_tiny_map(cp, ring, entry, tentry); |
2852 | cas_write_txd(cp, ring, entry, mapping, tabort, ctrl, | 2852 | cas_write_txd(cp, ring, entry, mapping, tabort, ctrl, |
2853 | (nr_frags == 0)); | 2853 | (nr_frags == 0)); |
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 43e92f9f0bcd..1be1bbd16164 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1062,7 +1062,7 @@ static inline struct sk_buff *get_packet(struct pci_dev *pdev, | |||
1062 | pci_unmap_addr(ce, dma_addr), | 1062 | pci_unmap_addr(ce, dma_addr), |
1063 | pci_unmap_len(ce, dma_len), | 1063 | pci_unmap_len(ce, dma_len), |
1064 | PCI_DMA_FROMDEVICE); | 1064 | PCI_DMA_FROMDEVICE); |
1065 | memcpy(skb->data, ce->skb->data, len); | 1065 | skb_copy_from_linear_data(ce->skb, skb->data, len); |
1066 | pci_dma_sync_single_for_device(pdev, | 1066 | pci_dma_sync_single_for_device(pdev, |
1067 | pci_unmap_addr(ce, dma_addr), | 1067 | pci_unmap_addr(ce, dma_addr), |
1068 | pci_unmap_len(ce, dma_len), | 1068 | pci_unmap_len(ce, dma_len), |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index c5faf1380e15..166c959c94b9 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -913,7 +913,8 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb, | |||
913 | if (skb->len <= WR_LEN - sizeof(*cpl)) { | 913 | if (skb->len <= WR_LEN - sizeof(*cpl)) { |
914 | q->sdesc[pidx].skb = NULL; | 914 | q->sdesc[pidx].skb = NULL; |
915 | if (!skb->data_len) | 915 | if (!skb->data_len) |
916 | memcpy(&d->flit[2], skb->data, skb->len); | 916 | skb_copy_from_linear_data(skb, &d->flit[2], |
917 | skb->len); | ||
917 | else | 918 | else |
918 | skb_copy_bits(skb, 0, &d->flit[2], skb->len); | 919 | skb_copy_bits(skb, 0, &d->flit[2], skb->len); |
919 | 920 | ||
@@ -1771,7 +1772,7 @@ static struct sk_buff *get_packet(struct adapter *adap, struct sge_fl *fl, | |||
1771 | __skb_put(skb, len); | 1772 | __skb_put(skb, len); |
1772 | pci_dma_sync_single_for_cpu(adap->pdev, mapping, len, | 1773 | pci_dma_sync_single_for_cpu(adap->pdev, mapping, len, |
1773 | PCI_DMA_FROMDEVICE); | 1774 | PCI_DMA_FROMDEVICE); |
1774 | memcpy(skb->data, sd->t.skb->data, len); | 1775 | skb_copy_from_linear_data(sd->t.skb, skb->data, len); |
1775 | pci_dma_sync_single_for_device(adap->pdev, mapping, len, | 1776 | pci_dma_sync_single_for_device(adap->pdev, mapping, len, |
1776 | PCI_DMA_FROMDEVICE); | 1777 | PCI_DMA_FROMDEVICE); |
1777 | } else if (!drop_thres) | 1778 | } else if (!drop_thres) |
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index d223c38966f4..df62c0232f36 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c | |||
@@ -741,7 +741,7 @@ static int dgrs_start_xmit(struct sk_buff *skb, struct net_device *devN) | |||
741 | } | 741 | } |
742 | 742 | ||
743 | amt = min_t(unsigned int, len, rbdp->size - count); | 743 | amt = min_t(unsigned int, len, rbdp->size - count); |
744 | memcpy( (char *) S2H(rbdp->buf) + count, skb->data + i, amt); | 744 | skb_copy_from_linear_data_offset(skb, i, S2H(rbdp->buf) + count, amt); |
745 | i += amt; | 745 | i += amt; |
746 | count += amt; | 746 | count += amt; |
747 | len -= amt; | 747 | len -= amt; |
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index db658bc491a9..6c267c38df97 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c | |||
@@ -1804,8 +1804,9 @@ speedo_rx(struct net_device *dev) | |||
1804 | eth_copy_and_sum(skb, sp->rx_skbuff[entry]->data, pkt_len, 0); | 1804 | eth_copy_and_sum(skb, sp->rx_skbuff[entry]->data, pkt_len, 0); |
1805 | skb_put(skb, pkt_len); | 1805 | skb_put(skb, pkt_len); |
1806 | #else | 1806 | #else |
1807 | memcpy(skb_put(skb, pkt_len), sp->rx_skbuff[entry]->data, | 1807 | skb_copy_from_linear_data(sp->rx_skbuff[entry], |
1808 | pkt_len); | 1808 | skb_put(skb, pkt_len), |
1809 | pkt_len); | ||
1809 | #endif | 1810 | #endif |
1810 | pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry], | 1811 | pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry], |
1811 | sizeof(struct RxFD) + pkt_len, | 1812 | sizeof(struct RxFD) + pkt_len, |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 63732d2305bb..8b5392072632 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -1306,7 +1306,7 @@ static void write_swqe2_TSO(struct sk_buff *skb, | |||
1306 | 1306 | ||
1307 | if (skb_data_size >= headersize) { | 1307 | if (skb_data_size >= headersize) { |
1308 | /* copy immediate data */ | 1308 | /* copy immediate data */ |
1309 | memcpy(imm_data, skb->data, headersize); | 1309 | skb_copy_from_linear_data(skb, imm_data, headersize); |
1310 | swqe->immediate_data_length = headersize; | 1310 | swqe->immediate_data_length = headersize; |
1311 | 1311 | ||
1312 | if (skb_data_size > headersize) { | 1312 | if (skb_data_size > headersize) { |
@@ -1337,7 +1337,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb, | |||
1337 | */ | 1337 | */ |
1338 | if (skb_data_size >= SWQE2_MAX_IMM) { | 1338 | if (skb_data_size >= SWQE2_MAX_IMM) { |
1339 | /* copy immediate data */ | 1339 | /* copy immediate data */ |
1340 | memcpy(imm_data, skb->data, SWQE2_MAX_IMM); | 1340 | skb_copy_from_linear_data(skb, imm_data, SWQE2_MAX_IMM); |
1341 | 1341 | ||
1342 | swqe->immediate_data_length = SWQE2_MAX_IMM; | 1342 | swqe->immediate_data_length = SWQE2_MAX_IMM; |
1343 | 1343 | ||
@@ -1350,7 +1350,7 @@ static void write_swqe2_nonTSO(struct sk_buff *skb, | |||
1350 | swqe->descriptors++; | 1350 | swqe->descriptors++; |
1351 | } | 1351 | } |
1352 | } else { | 1352 | } else { |
1353 | memcpy(imm_data, skb->data, skb_data_size); | 1353 | skb_copy_from_linear_data(skb, imm_data, skb_data_size); |
1354 | swqe->immediate_data_length = skb_data_size; | 1354 | swqe->immediate_data_length = skb_data_size; |
1355 | } | 1355 | } |
1356 | } | 1356 | } |
@@ -1772,10 +1772,11 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev, | |||
1772 | /* copy (immediate) data */ | 1772 | /* copy (immediate) data */ |
1773 | if (nfrags == 0) { | 1773 | if (nfrags == 0) { |
1774 | /* data is in a single piece */ | 1774 | /* data is in a single piece */ |
1775 | memcpy(imm_data, skb->data, skb->len); | 1775 | skb_copy_from_linear_data(skb, imm_data, skb->len); |
1776 | } else { | 1776 | } else { |
1777 | /* first copy data from the skb->data buffer ... */ | 1777 | /* first copy data from the skb->data buffer ... */ |
1778 | memcpy(imm_data, skb->data, skb->len - skb->data_len); | 1778 | skb_copy_from_linear_data(skb, imm_data, |
1779 | skb->len - skb->data_len); | ||
1779 | imm_data += skb->len - skb->data_len; | 1780 | imm_data += skb->len - skb->data_len; |
1780 | 1781 | ||
1781 | /* ... then copy data from the fragments */ | 1782 | /* ... then copy data from the fragments */ |
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 698dba8f2aa1..e824d5d231af 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c | |||
@@ -551,7 +551,9 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget) | |||
551 | skbn = dev_alloc_skb(pkt_len + 2); | 551 | skbn = dev_alloc_skb(pkt_len + 2); |
552 | if (skbn != NULL) { | 552 | if (skbn != NULL) { |
553 | skb_reserve(skbn, 2); /* align IP header */ | 553 | skb_reserve(skbn, 2); /* align IP header */ |
554 | memcpy(skbn->data, skb->data, pkt_len); | 554 | skb_copy_from_linear_data(skb |
555 | skbn->data, | ||
556 | pkt_len); | ||
555 | /* swap */ | 557 | /* swap */ |
556 | skbt = skb; | 558 | skbt = skb; |
557 | skb = skbn; | 559 | skb = skbn; |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 9f6ef315ce51..e2ddd617493a 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -160,7 +160,8 @@ static int fs_enet_rx_napi(struct net_device *dev, int *budget) | |||
160 | skbn = dev_alloc_skb(pkt_len + 2); | 160 | skbn = dev_alloc_skb(pkt_len + 2); |
161 | if (skbn != NULL) { | 161 | if (skbn != NULL) { |
162 | skb_reserve(skbn, 2); /* align IP header */ | 162 | skb_reserve(skbn, 2); /* align IP header */ |
163 | memcpy(skbn->data, skb->data, pkt_len); | 163 | skb_copy_from_linear_data(skb, |
164 | skbn->data, pkt_len); | ||
164 | /* swap */ | 165 | /* swap */ |
165 | skbt = skb; | 166 | skbt = skb; |
166 | skb = skbn; | 167 | skb = skbn; |
@@ -293,7 +294,8 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
293 | skbn = dev_alloc_skb(pkt_len + 2); | 294 | skbn = dev_alloc_skb(pkt_len + 2); |
294 | if (skbn != NULL) { | 295 | if (skbn != NULL) { |
295 | skb_reserve(skbn, 2); /* align IP header */ | 296 | skb_reserve(skbn, 2); /* align IP header */ |
296 | memcpy(skbn->data, skb->data, pkt_len); | 297 | skb_copy_from_linear_data(skb, |
298 | skbn->data, pkt_len); | ||
297 | /* swap */ | 299 | /* swap */ |
298 | skbt = skb; | 300 | skbt = skb; |
299 | skb = skbn; | 301 | skb = skbn; |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 0fbb414b5a4d..3be8c5047599 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -930,7 +930,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
930 | 930 | ||
931 | /* Transfer data to DMA buffer */ | 931 | /* Transfer data to DMA buffer */ |
932 | i = priv->tx_head; | 932 | i = priv->tx_head; |
933 | memcpy(priv->tx_buf[i], skb->data + 1, skb->len - 1); | 933 | skb_copy_from_linear_data_offset(skb, 1, priv->tx_buf[i], skb->len - 1); |
934 | priv->tx_len[i] = skb->len - 1; | 934 | priv->tx_len[i] = skb->len - 1; |
935 | 935 | ||
936 | /* Clear interrupts while we touch our circular buffers */ | 936 | /* Clear interrupts while we touch our circular buffers */ |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index f5a17ad9d3d6..b33adc6a340b 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -317,7 +317,9 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s) | |||
317 | dev_kfree_skb_irq(skb); | 317 | dev_kfree_skb_irq(skb); |
318 | break; | 318 | break; |
319 | } | 319 | } |
320 | memcpy(s->hdlctx.buffer, skb->data+1, pkt_len); | 320 | skb_copy_from_linear_data_offset(skb, 1, |
321 | s->hdlctx.buffer, | ||
322 | pkt_len); | ||
321 | dev_kfree_skb_irq(skb); | 323 | dev_kfree_skb_irq(skb); |
322 | s->hdlctx.bp = s->hdlctx.buffer; | 324 | s->hdlctx.bp = s->hdlctx.buffer; |
323 | append_crc_ccitt(s->hdlctx.buffer, pkt_len); | 325 | append_crc_ccitt(s->hdlctx.buffer, pkt_len); |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index ee3ea4fa729f..ac2d6dd9dbe4 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -638,7 +638,9 @@ static void yam_tx_byte(struct net_device *dev, struct yam_port *yp) | |||
638 | dev_kfree_skb_any(skb); | 638 | dev_kfree_skb_any(skb); |
639 | break; | 639 | break; |
640 | } | 640 | } |
641 | memcpy(yp->tx_buf, skb->data + 1, yp->tx_len); | 641 | skb_copy_from_linear_data_offset(skb->data, 1, |
642 | yp->tx_buf, | ||
643 | yp->tx_len); | ||
642 | dev_kfree_skb_any(skb); | 644 | dev_kfree_skb_any(skb); |
643 | yp->tx_count = 0; | 645 | yp->tx_count = 0; |
644 | yp->tx_crcl = 0x21; | 646 | yp->tx_crcl = 0x21; |
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index bc62e770a256..f749e07c6425 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c | |||
@@ -1443,7 +1443,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1443 | 1443 | ||
1444 | if (len <= 104) { | 1444 | if (len <= 104) { |
1445 | /* Short packet, let's copy it directly into the ring. */ | 1445 | /* Short packet, let's copy it directly into the ring. */ |
1446 | memcpy(desc->data, skb->data, skb->len); | 1446 | skb_copy_from_linear_data(skb, desc->data, skb->len); |
1447 | if (len < ETH_ZLEN) { | 1447 | if (len < ETH_ZLEN) { |
1448 | /* Very short packet, pad with zeros at the end. */ | 1448 | /* Very short packet, pad with zeros at the end. */ |
1449 | memset(desc->data + len, 0, ETH_ZLEN - len); | 1449 | memset(desc->data + len, 0, ETH_ZLEN - len); |
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index 0f10758226fa..fb2248a25516 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -1472,9 +1472,8 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1472 | 1472 | ||
1473 | self->stats.tx_bytes += skb->len; | 1473 | self->stats.tx_bytes += skb->len; |
1474 | 1474 | ||
1475 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 1475 | skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start, |
1476 | skb->len); | 1476 | skb->len); |
1477 | |||
1478 | self->tx_fifo.len++; | 1477 | self->tx_fifo.len++; |
1479 | self->tx_fifo.free++; | 1478 | self->tx_fifo.free++; |
1480 | 1479 | ||
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 27afd0f367d6..cdd1f6c1e741 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -526,7 +526,7 @@ static int au1k_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
526 | 526 | ||
527 | if (aup->speed == 4000000) { | 527 | if (aup->speed == 4000000) { |
528 | /* FIR */ | 528 | /* FIR */ |
529 | memcpy((void *)pDB->vaddr, skb->data, skb->len); | 529 | skb_copy_from_linear_data(skb, pDB->vaddr, skb->len); |
530 | ptxd->count_0 = skb->len & 0xff; | 530 | ptxd->count_0 = skb->len & 0xff; |
531 | ptxd->count_1 = (skb->len >> 8) & 0xff; | 531 | ptxd->count_1 = (skb->len >> 8) & 0xff; |
532 | 532 | ||
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index ddfa6c38a16b..9987a0dc1eaf 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1119,7 +1119,7 @@ dumpbufs(skb->data,skb->len,'>'); | |||
1119 | else | 1119 | else |
1120 | { | 1120 | { |
1121 | len = skb->len; | 1121 | len = skb->len; |
1122 | memcpy (self->tx_bufs[self->txs], skb->data, len); | 1122 | skb_copy_from_linear_data(skb, self->tx_bufs[self->txs], len); |
1123 | } | 1123 | } |
1124 | self->ring->tx[self->txs].len = len & 0x0fff; | 1124 | self->ring->tx[self->txs].len = len & 0x0fff; |
1125 | 1125 | ||
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 6ef375a095f4..0ac240ca905b 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -441,7 +441,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
441 | goto drop; | 441 | goto drop; |
442 | } | 442 | } |
443 | 443 | ||
444 | memcpy(self->tx_buff + self->header_length, skb->data, skb->len); | 444 | skb_copy_from_linear_data(skb, self->tx_buff + self->header_length, skb->len); |
445 | 445 | ||
446 | /* Change setting for next frame */ | 446 | /* Change setting for next frame */ |
447 | if (self->capability & IUC_STIR421X) { | 447 | if (self->capability & IUC_STIR421X) { |
@@ -902,7 +902,7 @@ static void irda_usb_receive(struct urb *urb) | |||
902 | 902 | ||
903 | if(docopy) { | 903 | if(docopy) { |
904 | /* Copy packet, so we can recycle the original */ | 904 | /* Copy packet, so we can recycle the original */ |
905 | memcpy(newskb->data, skb->data, urb->actual_length); | 905 | skb_copy_from_linear_data(skb, newskb->data, urb->actual_length); |
906 | /* Deliver this new skb */ | 906 | /* Deliver this new skb */ |
907 | dataskb = newskb; | 907 | dataskb = newskb; |
908 | /* And hook the old skb to the URB | 908 | /* And hook the old skb to the URB |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 3ff1f4b33c06..4b0037e498f8 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -353,7 +353,7 @@ static unsigned mcs_wrap_fir_skb(const struct sk_buff *skb, __u8 *buf) | |||
353 | buf[0] = len & 0xff; | 353 | buf[0] = len & 0xff; |
354 | buf[1] = (len >> 8) & 0xff; | 354 | buf[1] = (len >> 8) & 0xff; |
355 | /* copy the data into the tx buffer. */ | 355 | /* copy the data into the tx buffer. */ |
356 | memcpy(buf+2, skb->data, skb->len); | 356 | skb_copy_from_linear_data(skb, buf + 2, skb->len); |
357 | /* put the fcs in the last four bytes in little endian order. */ | 357 | /* put the fcs in the last four bytes in little endian order. */ |
358 | buf[len - 4] = fcs & 0xff; | 358 | buf[len - 4] = fcs & 0xff; |
359 | buf[len - 3] = (fcs >> 8) & 0xff; | 359 | buf[len - 3] = (fcs >> 8) & 0xff; |
@@ -377,7 +377,7 @@ static unsigned mcs_wrap_mir_skb(const struct sk_buff *skb, __u8 *buf) | |||
377 | buf[0] = len & 0xff; | 377 | buf[0] = len & 0xff; |
378 | buf[1] = (len >> 8) & 0xff; | 378 | buf[1] = (len >> 8) & 0xff; |
379 | /* copy the data */ | 379 | /* copy the data */ |
380 | memcpy(buf+2, skb->data, skb->len); | 380 | skb_copy_from_linear_data(skb, buf + 2, skb->len); |
381 | /* put the fcs in last two bytes in little endian order. */ | 381 | /* put the fcs in last two bytes in little endian order. */ |
382 | buf[len - 2] = fcs & 0xff; | 382 | buf[len - 2] = fcs & 0xff; |
383 | buf[len - 1] = (fcs >> 8) & 0xff; | 383 | buf[len - 1] = (fcs >> 8) & 0xff; |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 8ce7dad582f4..0ff992714136 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -1466,9 +1466,8 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1466 | 1466 | ||
1467 | self->stats.tx_bytes += skb->len; | 1467 | self->stats.tx_bytes += skb->len; |
1468 | 1468 | ||
1469 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 1469 | skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start, |
1470 | skb->len); | 1470 | skb->len); |
1471 | |||
1472 | self->tx_fifo.len++; | 1471 | self->tx_fifo.len++; |
1473 | self->tx_fifo.free++; | 1472 | self->tx_fifo.free++; |
1474 | 1473 | ||
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index f35d7d42624e..b3e1107420af 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -484,7 +484,7 @@ static int pxa_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
484 | unsigned long mtt = irda_get_mtt(skb); | 484 | unsigned long mtt = irda_get_mtt(skb); |
485 | 485 | ||
486 | si->dma_tx_buff_len = skb->len; | 486 | si->dma_tx_buff_len = skb->len; |
487 | memcpy(si->dma_tx_buff, skb->data, skb->len); | 487 | skb_copy_from_linear_data(skb, si->dma_tx_buff, skb->len); |
488 | 488 | ||
489 | if (mtt) | 489 | if (mtt) |
490 | while ((unsigned)(OSCR - si->last_oscr)/4 < mtt) | 490 | while ((unsigned)(OSCR - si->last_oscr)/4 < mtt) |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index e8453868d741..198bf3bfa70f 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -1162,7 +1162,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1162 | self->new_speed = speed; | 1162 | self->new_speed = speed; |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | memcpy(self->tx_buff.head, skb->data, skb->len); | 1165 | skb_copy_from_linear_data(skb, self->tx_buff.head, skb->len); |
1166 | 1166 | ||
1167 | self->tx_buff.len = skb->len; | 1167 | self->tx_buff.len = skb->len; |
1168 | self->tx_buff.data = self->tx_buff.head; | 1168 | self->tx_buff.data = self->tx_buff.head; |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 5ff416314604..45bbd6686151 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -925,8 +925,8 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb, | |||
925 | 925 | ||
926 | self->tx_fifo.tail += skb->len; | 926 | self->tx_fifo.tail += skb->len; |
927 | self->stats.tx_bytes += skb->len; | 927 | self->stats.tx_bytes += skb->len; |
928 | memcpy(self->tx_fifo.queue[self->tx_fifo.free].start, skb->data, | 928 | skb_copy_from_linear_data(skb, |
929 | skb->len); | 929 | self->tx_fifo.queue[self->tx_fifo.free].start, skb->len); |
930 | self->tx_fifo.len++; | 930 | self->tx_fifo.len++; |
931 | self->tx_fifo.free++; | 931 | self->tx_fifo.free++; |
932 | //F01 if (self->tx_fifo.len == 1) { | 932 | //F01 if (self->tx_fifo.len == 1) { |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 79b407f3a49a..c4be973867a6 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -993,7 +993,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
993 | goto drop; | 993 | goto drop; |
994 | } | 994 | } |
995 | else | 995 | else |
996 | memcpy(rd->buf, skb->data, len); | 996 | skb_copy_from_linear_data(skb, rd->buf, len); |
997 | } | 997 | } |
998 | 998 | ||
999 | rd->skb = skb; /* remember skb for tx-complete stats */ | 999 | rd->skb = skb; /* remember skb for tx-complete stats */ |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index bee445130952..0d4a68618fc1 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -529,7 +529,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
529 | /* Decide if we should use PIO or DMA transfer */ | 529 | /* Decide if we should use PIO or DMA transfer */ |
530 | if (self->io.speed > PIO_MAX_SPEED) { | 530 | if (self->io.speed > PIO_MAX_SPEED) { |
531 | self->tx_buff.data = self->tx_buff.head; | 531 | self->tx_buff.data = self->tx_buff.head; |
532 | memcpy(self->tx_buff.data, skb->data, skb->len); | 532 | skb_copy_from_linear_data(skb, self->tx_buff.data, skb->len); |
533 | self->tx_buff.len = skb->len; | 533 | self->tx_buff.len = skb->len; |
534 | 534 | ||
535 | mtt = irda_get_mtt(skb); | 535 | mtt = irda_get_mtt(skb); |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 11cbcb946db4..0fe96c85828b 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -988,7 +988,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
988 | if (lance_debug > 5) | 988 | if (lance_debug > 5) |
989 | printk("%s: bouncing a high-memory packet (%#x).\n", | 989 | printk("%s: bouncing a high-memory packet (%#x).\n", |
990 | dev->name, (u32)isa_virt_to_bus(skb->data)); | 990 | dev->name, (u32)isa_virt_to_bus(skb->data)); |
991 | memcpy(&lp->tx_bounce_buffs[entry], skb->data, skb->len); | 991 | skb_copy_from_linear_data(skb, &lp->tx_bounce_buffs[entry], skb->len); |
992 | lp->tx_ring[entry].base = | 992 | lp->tx_ring[entry].base = |
993 | ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000; | 993 | ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000; |
994 | dev_kfree_skb(skb); | 994 | dev_kfree_skb(skb); |
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c index 8c07ffc9c244..27911c07558d 100644 --- a/drivers/net/macmace.c +++ b/drivers/net/macmace.c | |||
@@ -420,8 +420,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) | |||
420 | mp->stats.tx_bytes += skb->len; | 420 | mp->stats.tx_bytes += skb->len; |
421 | 421 | ||
422 | /* We need to copy into our xmit buffer to take care of alignment and caching issues */ | 422 | /* We need to copy into our xmit buffer to take care of alignment and caching issues */ |
423 | 423 | skb_copy_from_linear_data(skb, mp->tx_ring, skb->len); | |
424 | memcpy((void *) mp->tx_ring, skb->data, skb->len); | ||
425 | 424 | ||
426 | /* load the Tx DMA and fire it off */ | 425 | /* load the Tx DMA and fire it off */ |
427 | 426 | ||
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index fafe67835238..0343ea12b299 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -608,7 +608,7 @@ static void meth_tx_short_prepare(struct meth_private *priv, | |||
608 | 608 | ||
609 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); | 609 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); |
610 | /* maybe I should set whole thing to 0 first... */ | 610 | /* maybe I should set whole thing to 0 first... */ |
611 | memcpy(desc->data.dt + (120 - len), skb->data, skb->len); | 611 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - len), skb->len); |
612 | if (skb->len < len) | 612 | if (skb->len < len) |
613 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); | 613 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); |
614 | } | 614 | } |
@@ -626,8 +626,8 @@ static void meth_tx_1page_prepare(struct meth_private *priv, | |||
626 | 626 | ||
627 | /* unaligned part */ | 627 | /* unaligned part */ |
628 | if (unaligned_len) { | 628 | if (unaligned_len) { |
629 | memcpy(desc->data.dt + (120 - unaligned_len), | 629 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
630 | skb->data, unaligned_len); | 630 | unaligned_len); |
631 | desc->header.raw |= (128 - unaligned_len) << 16; | 631 | desc->header.raw |= (128 - unaligned_len) << 16; |
632 | } | 632 | } |
633 | 633 | ||
@@ -652,8 +652,8 @@ static void meth_tx_2page_prepare(struct meth_private *priv, | |||
652 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); | 652 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); |
653 | /* unaligned part */ | 653 | /* unaligned part */ |
654 | if (unaligned_len){ | 654 | if (unaligned_len){ |
655 | memcpy(desc->data.dt + (120 - unaligned_len), | 655 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
656 | skb->data, unaligned_len); | 656 | unaligned_len); |
657 | desc->header.raw |= (128 - unaligned_len) << 16; | 657 | desc->header.raw |= (128 - unaligned_len) << 16; |
658 | } | 658 | } |
659 | 659 | ||
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index e1f16fb05846..13444da93273 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -502,7 +502,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) | |||
502 | copy_skb->dev = dev; | 502 | copy_skb->dev = dev; |
503 | DRX(("resv_and_put ")); | 503 | DRX(("resv_and_put ")); |
504 | skb_put(copy_skb, len); | 504 | skb_put(copy_skb, len); |
505 | memcpy(copy_skb->data, skb->data, len); | 505 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
506 | 506 | ||
507 | /* Reuse original ring buffer. */ | 507 | /* Reuse original ring buffer. */ |
508 | DRX(("reuse ")); | 508 | DRX(("reuse ")); |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index b488e94bc4c0..ab25c225a07e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -920,8 +920,10 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
920 | /* copy the next 64 bytes - should be enough except | 920 | /* copy the next 64 bytes - should be enough except |
921 | * for pathological case | 921 | * for pathological case |
922 | */ | 922 | */ |
923 | memcpy((void *)hwdesc, (void *)(skb->data) + | 923 | skb_copy_from_linear_data_offset(skb, first_hdr_len, |
924 | first_hdr_len, hdr_len - first_hdr_len); | 924 | hwdesc, |
925 | (hdr_len - | ||
926 | first_hdr_len)); | ||
925 | producer = get_next_index(producer, max_tx_desc_count); | 927 | producer = get_next_index(producer, max_tx_desc_count); |
926 | } | 928 | } |
927 | } | 929 | } |
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c index 70b6812a8a75..8646698c77d4 100644 --- a/drivers/net/ni52.c +++ b/drivers/net/ni52.c | |||
@@ -1182,7 +1182,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1182 | else | 1182 | else |
1183 | #endif | 1183 | #endif |
1184 | { | 1184 | { |
1185 | memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len); | 1185 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1186 | len = skb->len; | 1186 | len = skb->len; |
1187 | if (len < ETH_ZLEN) { | 1187 | if (len < ETH_ZLEN) { |
1188 | len = ETH_ZLEN; | 1188 | len = ETH_ZLEN; |
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c index 782201d12c22..3818edf0ac18 100644 --- a/drivers/net/ni65.c +++ b/drivers/net/ni65.c | |||
@@ -1176,8 +1176,9 @@ static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1176 | if( (unsigned long) (skb->data + skb->len) > 0x1000000) { | 1176 | if( (unsigned long) (skb->data + skb->len) > 0x1000000) { |
1177 | #endif | 1177 | #endif |
1178 | 1178 | ||
1179 | memcpy((char *) p->tmdbounce[p->tmdbouncenum] ,(char *)skb->data, | 1179 | skb_copy_from_linear_data(skb, p->tmdbounce[p->tmdbouncenum], |
1180 | (skb->len > T_BUF_SIZE) ? T_BUF_SIZE : skb->len); | 1180 | skb->len > T_BUF_SIZE ? T_BUF_SIZE : |
1181 | skb->len); | ||
1181 | if (len > skb->len) | 1182 | if (len > skb->len) |
1182 | memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len); | 1183 | memset((char *)p->tmdbounce[p->tmdbouncenum]+skb->len, 0, len-skb->len); |
1183 | dev_kfree_skb (skb); | 1184 | dev_kfree_skb (skb); |
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index 099972c977ef..df8998b4f37e 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
@@ -1344,7 +1344,7 @@ static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1344 | 1344 | ||
1345 | tp->tx_info[entry].skb = skb; | 1345 | tp->tx_info[entry].skb = skb; |
1346 | /* tp->tx_info[entry].mapping = 0; */ | 1346 | /* tp->tx_info[entry].mapping = 0; */ |
1347 | memcpy (tp->tx_buf[entry], skb->data, skb->len); | 1347 | skb_copy_from_linear_data(skb, tp->tx_buf[entry], skb->len); |
1348 | 1348 | ||
1349 | /* Note: the chip doesn't have auto-pad! */ | 1349 | /* Note: the chip doesn't have auto-pad! */ |
1350 | NETDRV_W32 (TxStatus0 + (entry * sizeof(u32)), | 1350 | NETDRV_W32 (TxStatus0 + (entry * sizeof(u32)), |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index fabbe95c7ef1..808fae1577e0 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1136,7 +1136,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1136 | ei_block_output(dev, length, skb->data, output_page); | 1136 | ei_block_output(dev, length, skb->data, output_page); |
1137 | else { | 1137 | else { |
1138 | memset(packet, 0, ETH_ZLEN); | 1138 | memset(packet, 0, ETH_ZLEN); |
1139 | memcpy(packet, skb->data, skb->len); | 1139 | skb_copy_from_linear_data(skb, packet, skb->len); |
1140 | ei_block_output(dev, length, packet, output_page); | 1140 | ei_block_output(dev, length, packet, output_page); |
1141 | } | 1141 | } |
1142 | 1142 | ||
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index b6f0e9a25e26..5918fab38349 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -594,7 +594,8 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb) | |||
594 | return NULL; | 594 | return NULL; |
595 | } | 595 | } |
596 | skb_reserve(npkt,2); | 596 | skb_reserve(npkt,2); |
597 | memcpy(skb_put(npkt,skb->len), skb->data, skb->len); | 597 | skb_copy_from_linear_data(skb, |
598 | skb_put(npkt, skb->len), skb->len); | ||
598 | kfree_skb(skb); | 599 | kfree_skb(skb); |
599 | skb = npkt; | 600 | skb = npkt; |
600 | } | 601 | } |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index e94790632d55..e9fb616ff663 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -869,7 +869,8 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
869 | goto abort; | 869 | goto abort; |
870 | 870 | ||
871 | skb_reserve(skb2, dev->hard_header_len + sizeof(struct pppoe_hdr)); | 871 | skb_reserve(skb2, dev->hard_header_len + sizeof(struct pppoe_hdr)); |
872 | memcpy(skb_put(skb2, skb->len), skb->data, skb->len); | 872 | skb_copy_from_linear_data(skb, skb_put(skb2, skb->len), |
873 | skb->len); | ||
873 | } else { | 874 | } else { |
874 | /* Make a clone so as to not disturb the original skb, | 875 | /* Make a clone so as to not disturb the original skb, |
875 | * give dev_queue_xmit something it can free. | 876 | * give dev_queue_xmit something it can free. |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 40d2639eedcb..7b80fb7a9d9b 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1927,7 +1927,8 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, | |||
1927 | * Copy the ethhdr from first buffer to second. This | 1927 | * Copy the ethhdr from first buffer to second. This |
1928 | * is necessary for 3022 IP completions. | 1928 | * is necessary for 3022 IP completions. |
1929 | */ | 1929 | */ |
1930 | memcpy(skb_push(skb2, size), skb1->data + VLAN_ID_LEN, size); | 1930 | skb_copy_from_linear_data_offset(skb1, VLAN_ID_LEN, |
1931 | skb_push(skb2, size), size); | ||
1931 | } else { | 1932 | } else { |
1932 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); | 1933 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); |
1933 | if (checksum & | 1934 | if (checksum & |
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index 3a4fce384504..25c73d47daad 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
@@ -1451,7 +1451,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1451 | } | 1451 | } |
1452 | skb_reserve(new_skb, 8); | 1452 | skb_reserve(new_skb, 8); |
1453 | skb_put(new_skb, len); | 1453 | skb_put(new_skb, len); |
1454 | memcpy(new_skb->data, skb->data, len); | 1454 | skb_copy_from_linear_data(skb, new_skb->data, len); |
1455 | dev_kfree_skb(skb); | 1455 | dev_kfree_skb(skb); |
1456 | skb = new_skb; | 1456 | skb = new_skb; |
1457 | } | 1457 | } |
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index 5a8919132186..d8c9c5d66d4f 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
@@ -534,7 +534,7 @@ static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
534 | * entry and the HPC got to the end of the chain before we | 534 | * entry and the HPC got to the end of the chain before we |
535 | * added this new entry and restarted it. | 535 | * added this new entry and restarted it. |
536 | */ | 536 | */ |
537 | memcpy((char *)(long)td->buf_vaddr, skb->data, skblen); | 537 | skb_copy_from_linear_data(skb, (char *)(long)td->buf_vaddr, skblen); |
538 | if (len != skblen) | 538 | if (len != skblen) |
539 | memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen); | 539 | memset((char *)(long)td->buf_vaddr + skb->len, 0, len-skblen); |
540 | td->tdma.cntinfo = (len & HPCDMA_BCNT) | | 540 | td->tdma.cntinfo = (len & HPCDMA_BCNT) | |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 99b61cfb7ce6..f1a0e6c0fbdd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -2950,7 +2950,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
2950 | pci_dma_sync_single_for_cpu(skge->hw->pdev, | 2950 | pci_dma_sync_single_for_cpu(skge->hw->pdev, |
2951 | pci_unmap_addr(e, mapaddr), | 2951 | pci_unmap_addr(e, mapaddr), |
2952 | len, PCI_DMA_FROMDEVICE); | 2952 | len, PCI_DMA_FROMDEVICE); |
2953 | memcpy(skb->data, e->skb->data, len); | 2953 | skb_copy_from_linear_data(e->skb, skb->data, len); |
2954 | pci_dma_sync_single_for_device(skge->hw->pdev, | 2954 | pci_dma_sync_single_for_device(skge->hw->pdev, |
2955 | pci_unmap_addr(e, mapaddr), | 2955 | pci_unmap_addr(e, mapaddr), |
2956 | len, PCI_DMA_FROMDEVICE); | 2956 | len, PCI_DMA_FROMDEVICE); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fd291fc93169..238c2ca34da6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1971,7 +1971,7 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2, | |||
1971 | skb_reserve(skb, 2); | 1971 | skb_reserve(skb, 2); |
1972 | pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr, | 1972 | pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr, |
1973 | length, PCI_DMA_FROMDEVICE); | 1973 | length, PCI_DMA_FROMDEVICE); |
1974 | memcpy(skb->data, re->skb->data, length); | 1974 | skb_copy_from_linear_data(re->skb, skb->data, length); |
1975 | skb->ip_summed = re->skb->ip_summed; | 1975 | skb->ip_summed = re->skb->ip_summed; |
1976 | skb->csum = re->skb->csum; | 1976 | skb->csum = re->skb->csum; |
1977 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, | 1977 | pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, |
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c index 5bcc749bef11..396c3d961f88 100644 --- a/drivers/net/sun3_82586.c +++ b/drivers/net/sun3_82586.c | |||
@@ -1026,7 +1026,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1026 | memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); | 1026 | memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN); |
1027 | len = ETH_ZLEN; | 1027 | len = ETH_ZLEN; |
1028 | } | 1028 | } |
1029 | memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len); | 1029 | skb_copy_from_linear_data(skb, p->xmit_cbuffs[p->xmit_count], skb->len); |
1030 | 1030 | ||
1031 | #if (NUM_XMIT_BUFFS == 1) | 1031 | #if (NUM_XMIT_BUFFS == 1) |
1032 | # ifdef NO_NOPCOMMANDS | 1032 | # ifdef NO_NOPCOMMANDS |
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 0454827c8c21..327ed7962fbd 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -629,7 +629,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
629 | head->length = (-len) | 0xf000; | 629 | head->length = (-len) | 0xf000; |
630 | head->misc = 0; | 630 | head->misc = 0; |
631 | 631 | ||
632 | memcpy( PKTBUF_ADDR(head), (void *)skb->data, skb->len ); | 632 | skb_copy_from_linear_data(skb, PKTBUF_ADDR(head), skb->len); |
633 | if (len != skb->len) | 633 | if (len != skb->len) |
634 | memset(PKTBUF_ADDR(head) + skb->len, 0, len-skb->len); | 634 | memset(PKTBUF_ADDR(head) + skb->len, 0, len-skb->len); |
635 | 635 | ||
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 4bb89dec5650..9df1038ec6bb 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -848,7 +848,7 @@ static int gem_rx(struct gem *gp, int work_to_do) | |||
848 | skb_reserve(copy_skb, 2); | 848 | skb_reserve(copy_skb, 2); |
849 | skb_put(copy_skb, len); | 849 | skb_put(copy_skb, len); |
850 | pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 850 | pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
851 | memcpy(copy_skb->data, skb->data, len); | 851 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
852 | pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 852 | pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
853 | 853 | ||
854 | /* We'll reuse the original ring buffer. */ | 854 | /* We'll reuse the original ring buffer. */ |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 4b69c1deb9f3..5304d7b94e5e 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2061,7 +2061,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) | |||
2061 | skb_reserve(copy_skb, 2); | 2061 | skb_reserve(copy_skb, 2); |
2062 | skb_put(copy_skb, len); | 2062 | skb_put(copy_skb, len); |
2063 | hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); | 2063 | hme_dma_sync_for_cpu(hp, dma_addr, len, DMA_FROMDEVICE); |
2064 | memcpy(copy_skb->data, skb->data, len); | 2064 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
2065 | hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); | 2065 | hme_dma_sync_for_device(hp, dma_addr, len, DMA_FROMDEVICE); |
2066 | 2066 | ||
2067 | /* Reuse original ring buffer. */ | 2067 | /* Reuse original ring buffer. */ |
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 8f53a1ef6083..42722530ab24 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -1143,7 +1143,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1143 | struct lance_init_block *ib = lp->init_block_mem; | 1143 | struct lance_init_block *ib = lp->init_block_mem; |
1144 | ib->btx_ring [entry].length = (-len) | 0xf000; | 1144 | ib->btx_ring [entry].length = (-len) | 0xf000; |
1145 | ib->btx_ring [entry].misc = 0; | 1145 | ib->btx_ring [entry].misc = 0; |
1146 | memcpy((char *)&ib->tx_buf [entry][0], skb->data, skblen); | 1146 | skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen); |
1147 | if (len != skblen) | 1147 | if (len != skblen) |
1148 | memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); | 1148 | memset((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); |
1149 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); | 1149 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); |
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index fbfb98284fde..fa70e0b78af7 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c | |||
@@ -592,7 +592,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
592 | /* Avoid a race... */ | 592 | /* Avoid a race... */ |
593 | qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE; | 593 | qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE; |
594 | 594 | ||
595 | memcpy(txbuf, skb->data, len); | 595 | skb_copy_from_linear_data(skb, txbuf, len); |
596 | 596 | ||
597 | qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma; | 597 | qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma; |
598 | qep->qe_block->qe_txd[entry].tx_flags = | 598 | qep->qe_block->qe_txd[entry].tx_flags = |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 414365c3198d..38383e4e07a1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3350,7 +3350,7 @@ static int tg3_rx(struct tg3 *tp, int budget) | |||
3350 | skb_reserve(copy_skb, 2); | 3350 | skb_reserve(copy_skb, 2); |
3351 | skb_put(copy_skb, len); | 3351 | skb_put(copy_skb, len); |
3352 | pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 3352 | pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
3353 | memcpy(copy_skb->data, skb->data, len); | 3353 | skb_copy_from_linear_data(skb, copy_skb->data, len); |
3354 | pci_dma_sync_single_for_device(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); | 3354 | pci_dma_sync_single_for_device(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE); |
3355 | 3355 | ||
3356 | /* We'll reuse the original ring buffer. */ | 3356 | /* We'll reuse the original ring buffer. */ |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 2ede3f58cf97..106dc1ef0acb 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -1112,7 +1112,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | |||
1112 | 1112 | ||
1113 | if ( bbuf ) { | 1113 | if ( bbuf ) { |
1114 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); | 1114 | tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE ); |
1115 | memcpy( tail_buffer, skb->data, skb->len ); | 1115 | skb_copy_from_linear_data(skb, tail_buffer, skb->len); |
1116 | } else { | 1116 | } else { |
1117 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE); | 1117 | tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE); |
1118 | TLan_StoreSKB(tail_list, skb); | 1118 | TLan_StoreSKB(tail_list, skb); |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index d293423ee8e3..e22a3f5333ef 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -937,14 +937,17 @@ static void xl_rx(struct net_device *dev) | |||
937 | copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; | 937 | copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; |
938 | frame_length -= copy_len ; | 938 | frame_length -= copy_len ; |
939 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 939 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
940 | memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, copy_len) ; | 940 | skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail], |
941 | skb_put(skb, copy_len), | ||
942 | copy_len); | ||
941 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 943 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
942 | adv_rx_ring(dev) ; | 944 | adv_rx_ring(dev) ; |
943 | } | 945 | } |
944 | 946 | ||
945 | /* Now we have found the last fragment */ | 947 | /* Now we have found the last fragment */ |
946 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 948 | pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
947 | memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, frame_length) ; | 949 | skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail], |
950 | skb_put(skb,copy_len), frame_length); | ||
948 | /* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */ | 951 | /* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */ |
949 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 952 | pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
950 | adv_rx_ring(dev) ; | 953 | adv_rx_ring(dev) ; |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index a62065808881..09b3cfb8e809 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -845,7 +845,9 @@ static void olympic_rx(struct net_device *dev) | |||
845 | pci_dma_sync_single_for_cpu(olympic_priv->pdev, | 845 | pci_dma_sync_single_for_cpu(olympic_priv->pdev, |
846 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 846 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
847 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 847 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
848 | memcpy(skb_put(skb,length-4),olympic_priv->rx_ring_skb[rx_ring_last_received]->data,length-4) ; | 848 | skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received], |
849 | skb_put(skb,length - 4), | ||
850 | length - 4); | ||
849 | pci_dma_sync_single_for_device(olympic_priv->pdev, | 851 | pci_dma_sync_single_for_device(olympic_priv->pdev, |
850 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 852 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
851 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 853 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
@@ -862,7 +864,9 @@ static void olympic_rx(struct net_device *dev) | |||
862 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 864 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
863 | rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]); | 865 | rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]); |
864 | cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); | 866 | cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); |
865 | memcpy(skb_put(skb, cpy_length), olympic_priv->rx_ring_skb[rx_ring_last_received]->data, cpy_length) ; | 867 | skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received], |
868 | skb_put(skb, cpy_length), | ||
869 | cpy_length); | ||
866 | pci_dma_sync_single_for_device(olympic_priv->pdev, | 870 | pci_dma_sync_single_for_device(olympic_priv->pdev, |
867 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), | 871 | le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), |
868 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; | 872 | olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; |
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index de6f72775ecc..e6f0817c3509 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -644,7 +644,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device | |||
644 | dmabuf = 0; | 644 | dmabuf = 0; |
645 | i = tp->TplFree->TPLIndex; | 645 | i = tp->TplFree->TPLIndex; |
646 | buf = tp->LocalTxBuffers[i]; | 646 | buf = tp->LocalTxBuffers[i]; |
647 | memcpy(buf, skb->data, length); | 647 | skb_copy_from_linear_data(skb, buf, length); |
648 | newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer; | 648 | newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer; |
649 | } | 649 | } |
650 | else { | 650 | else { |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 8a7effa70904..d19f8568440f 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -449,8 +449,8 @@ static void de_rx (struct de_private *de) | |||
449 | } else { | 449 | } else { |
450 | pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); | 450 | pci_dma_sync_single_for_cpu(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); |
451 | skb_reserve(copy_skb, RX_OFFSET); | 451 | skb_reserve(copy_skb, RX_OFFSET); |
452 | memcpy(skb_put(copy_skb, len), skb->data, len); | 452 | skb_copy_from_linear_data(skb, skb_put(copy_skb, len), |
453 | 453 | len); | |
454 | pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); | 454 | pci_dma_sync_single_for_device(de->pdev, mapping, len, PCI_DMA_FROMDEVICE); |
455 | 455 | ||
456 | /* We'll reuse the original ring buffer. */ | 456 | /* We'll reuse the original ring buffer. */ |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index a5e0237a6537..b3a64ca98634 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -682,7 +682,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev) | |||
682 | 682 | ||
683 | /* transmit this packet */ | 683 | /* transmit this packet */ |
684 | txptr = db->tx_insert_ptr; | 684 | txptr = db->tx_insert_ptr; |
685 | memcpy(txptr->tx_buf_ptr, skb->data, skb->len); | 685 | skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len); |
686 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); | 686 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); |
687 | 687 | ||
688 | /* Point to next transmit free descriptor */ | 688 | /* Point to next transmit free descriptor */ |
@@ -989,7 +989,9 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) | |||
989 | skb = newskb; | 989 | skb = newskb; |
990 | /* size less than COPY_SIZE, allocate a rxlen SKB */ | 990 | /* size less than COPY_SIZE, allocate a rxlen SKB */ |
991 | skb_reserve(skb, 2); /* 16byte align */ | 991 | skb_reserve(skb, 2); /* 16byte align */ |
992 | memcpy(skb_put(skb, rxlen), rxptr->rx_skb_ptr->data, rxlen); | 992 | skb_copy_from_linear_data(rxptr->rx_skb_ptr, |
993 | skb_put(skb, rxlen), | ||
994 | rxlen); | ||
993 | dmfe_reuse_skb(db, rxptr->rx_skb_ptr); | 995 | dmfe_reuse_skb(db, rxptr->rx_skb_ptr); |
994 | } else | 996 | } else |
995 | skb_put(skb, rxlen); | 997 | skb_put(skb, rxlen); |
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index e46f4cb02c15..ca2548eb7d63 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -583,7 +583,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
583 | 583 | ||
584 | /* transmit this packet */ | 584 | /* transmit this packet */ |
585 | txptr = db->tx_insert_ptr; | 585 | txptr = db->tx_insert_ptr; |
586 | memcpy(txptr->tx_buf_ptr, skb->data, skb->len); | 586 | skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len); |
587 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); | 587 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); |
588 | 588 | ||
589 | /* Point to next transmit free descriptor */ | 589 | /* Point to next transmit free descriptor */ |
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 1fe3734e155b..985a1810ca59 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -411,9 +411,9 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
411 | sometimes sends more than you ask it to. */ | 411 | sometimes sends more than you ask it to. */ |
412 | 412 | ||
413 | memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536); | 413 | memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536); |
414 | memcpy(&(card->tx_buffer[bufferoffsets[desc]/4]),skb->data,skb->len); | 414 | skb_copy_from_linear_data(skb, |
415 | 415 | &(card->tx_buffer[bufferoffsets[desc] / 4]), | |
416 | 416 | skb->len); | |
417 | /* FIXME: The specification tells us that the length we send HAS to be a multiple of | 417 | /* FIXME: The specification tells us that the length we send HAS to be a multiple of |
418 | 4 bytes. */ | 418 | 4 bytes. */ |
419 | 419 | ||
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index 3f24c82755fc..696b3b8aac8e 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c | |||
@@ -915,7 +915,9 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
915 | 915 | ||
916 | tp->tx_skbuff[entry] = skb; | 916 | tp->tx_skbuff[entry] = skb; |
917 | if (tp->chip_id == X3201_3) { | 917 | if (tp->chip_id == X3201_3) { |
918 | memcpy(tp->tx_aligned_skbuff[entry]->data,skb->data,skb->len); | 918 | skb_copy_from_linear_data(skb, |
919 | tp->tx_aligned_skbuff[entry]->data, | ||
920 | skb->len); | ||
919 | tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data); | 921 | tp->tx_ring[entry].buffer1 = virt_to_bus(tp->tx_aligned_skbuff[entry]->data); |
920 | } else | 922 | } else |
921 | tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data); | 923 | tp->tx_ring[entry].buffer1 = virt_to_bus(skb->data); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 288d8559f8c5..4d461595406d 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -386,8 +386,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv, | |||
386 | * - we are multicast promiscous. | 386 | * - we are multicast promiscous. |
387 | * - we belong to the multicast group. | 387 | * - we belong to the multicast group. |
388 | */ | 388 | */ |
389 | memcpy(addr, skb->data, | 389 | skb_copy_from_linear_data(skb, addr, min_t(size_t, sizeof addr, |
390 | min_t(size_t, sizeof addr, skb->len)); | 390 | skb->len)); |
391 | bit_nr = ether_crc(sizeof addr, addr) >> 26; | 391 | bit_nr = ether_crc(sizeof addr, addr) >> 26; |
392 | if ((tun->if_flags & IFF_PROMISC) || | 392 | if ((tun->if_flags & IFF_PROMISC) || |
393 | memcmp(addr, tun->dev_addr, sizeof addr) == 0 || | 393 | memcmp(addr, tun->dev_addr, sizeof addr) == 0 || |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 422eaf8ea12d..25b75b615188 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1339,7 +1339,8 @@ static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, | |||
1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) | 1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) |
1340 | skb_reserve(new_skb, 2); | 1340 | skb_reserve(new_skb, 2); |
1341 | 1341 | ||
1342 | memcpy(new_skb->data, rx_skb[0]->data, pkt_size); | 1342 | skb_copy_from_linear_data(rx_skb[0], new_skb->data, |
1343 | pkt_size); | ||
1343 | *rx_skb = new_skb; | 1344 | *rx_skb = new_skb; |
1344 | ret = 0; | 1345 | ret = 0; |
1345 | } | 1346 | } |
@@ -1927,7 +1928,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1927 | if (pktlen < ETH_ZLEN) { | 1928 | if (pktlen < ETH_ZLEN) { |
1928 | /* Cannot occur until ZC support */ | 1929 | /* Cannot occur until ZC support */ |
1929 | pktlen = ETH_ZLEN; | 1930 | pktlen = ETH_ZLEN; |
1930 | memcpy(tdinfo->buf, skb->data, skb->len); | 1931 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1931 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); | 1932 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); |
1932 | tdinfo->skb = skb; | 1933 | tdinfo->skb = skb; |
1933 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1934 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
@@ -1943,7 +1944,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1943 | int nfrags = skb_shinfo(skb)->nr_frags; | 1944 | int nfrags = skb_shinfo(skb)->nr_frags; |
1944 | tdinfo->skb = skb; | 1945 | tdinfo->skb = skb; |
1945 | if (nfrags > 6) { | 1946 | if (nfrags > 6) { |
1946 | memcpy(tdinfo->buf, skb->data, skb->len); | 1947 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1947 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1948 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
1948 | td_ptr->tdesc0.pktsize = | 1949 | td_ptr->tdesc0.pktsize = |
1949 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); | 1950 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index a576113abbd9..ae132c1c5459 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -1702,7 +1702,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/ | |||
1702 | if(!nsb) { | 1702 | if(!nsb) { |
1703 | goto give_it_anyways; | 1703 | goto give_it_anyways; |
1704 | } | 1704 | } |
1705 | memcpy(skb_put(nsb, len), skb->data, len); | 1705 | skb_copy_from_linear_data(skb, skb_put(nsb, len), len); |
1706 | 1706 | ||
1707 | nsb->protocol = lmc_proto_type(sc, skb); | 1707 | nsb->protocol = lmc_proto_type(sc, skb); |
1708 | skb_reset_mac_header(nsb); | 1708 | skb_reset_mac_header(nsb); |
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index edbc55528be5..8ba75bb17326 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -1765,7 +1765,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx) | |||
1765 | skb->data[7] = ']'; | 1765 | skb->data[7] = ']'; |
1766 | skb->data[8] = ':'; | 1766 | skb->data[8] = ':'; |
1767 | skb->data[9] = ' '; | 1767 | skb->data[9] = ' '; |
1768 | memcpy(&skb->data[10], skb_main->data, skb_main->len); | 1768 | skb_copy_from_linear_data(skb_main, &skb->data[10], skb_main->len); |
1769 | 1769 | ||
1770 | netif_rx(skb); | 1770 | netif_rx(skb); |
1771 | } | 1771 | } |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 8b4540bfc1b0..9432d2ce7745 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -1782,7 +1782,7 @@ int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb) | |||
1782 | */ | 1782 | */ |
1783 | c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used]; | 1783 | c->tx_next_ptr=c->tx_dma_buf[c->tx_dma_used]; |
1784 | c->tx_dma_used^=1; /* Flip temp buffer */ | 1784 | c->tx_dma_used^=1; /* Flip temp buffer */ |
1785 | memcpy(c->tx_next_ptr, skb->data, skb->len); | 1785 | skb_copy_from_linear_data(skb, c->tx_next_ptr, skb->len); |
1786 | } | 1786 | } |
1787 | else | 1787 | else |
1788 | c->tx_next_ptr=skb->data; | 1788 | c->tx_next_ptr=skb->data; |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 1c17cbe007ba..51a7db53afa5 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -827,14 +827,14 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
827 | if (priv->wep_is_on) | 827 | if (priv->wep_is_on) |
828 | frame_ctl |= IEEE80211_FCTL_PROTECTED; | 828 | frame_ctl |= IEEE80211_FCTL_PROTECTED; |
829 | if (priv->operating_mode == IW_MODE_ADHOC) { | 829 | if (priv->operating_mode == IW_MODE_ADHOC) { |
830 | memcpy(&header.addr1, skb->data, 6); | 830 | skb_copy_from_linear_data(skb, &header.addr1, 6); |
831 | memcpy(&header.addr2, dev->dev_addr, 6); | 831 | memcpy(&header.addr2, dev->dev_addr, 6); |
832 | memcpy(&header.addr3, priv->BSSID, 6); | 832 | memcpy(&header.addr3, priv->BSSID, 6); |
833 | } else { | 833 | } else { |
834 | frame_ctl |= IEEE80211_FCTL_TODS; | 834 | frame_ctl |= IEEE80211_FCTL_TODS; |
835 | memcpy(&header.addr1, priv->CurrentBSSID, 6); | 835 | memcpy(&header.addr1, priv->CurrentBSSID, 6); |
836 | memcpy(&header.addr2, dev->dev_addr, 6); | 836 | memcpy(&header.addr2, dev->dev_addr, 6); |
837 | memcpy(&header.addr3, skb->data, 6); | 837 | skb_copy_from_linear_data(skb, &header.addr3, 6); |
838 | } | 838 | } |
839 | 839 | ||
840 | if (priv->use_wpa) | 840 | if (priv->use_wpa) |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index 6e0dc76400e5..e3d2e61a31ee 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -998,7 +998,8 @@ static void dma_tx_fragment(struct bcm43xx_dmaring *ring, | |||
998 | assert(0); | 998 | assert(0); |
999 | return; | 999 | return; |
1000 | } | 1000 | } |
1001 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); | 1001 | skb_copy_from_linear_data(skb, skb_put(bounce_skb, skb->len), |
1002 | skb->len); | ||
1002 | dev_kfree_skb_any(skb); | 1003 | dev_kfree_skb_any(skb); |
1003 | skb = bounce_skb; | 1004 | skb = bounce_skb; |
1004 | } | 1005 | } |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 35a3a50724fe..cbedc9ee740a 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -933,12 +933,14 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
933 | if (frag == 0) { | 933 | if (frag == 0) { |
934 | /* copy first fragment (including full headers) into | 934 | /* copy first fragment (including full headers) into |
935 | * beginning of the fragment cache skb */ | 935 | * beginning of the fragment cache skb */ |
936 | memcpy(skb_put(frag_skb, flen), skb->data, flen); | 936 | skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), |
937 | flen); | ||
937 | } else { | 938 | } else { |
938 | /* append frame payload to the end of the fragment | 939 | /* append frame payload to the end of the fragment |
939 | * cache skb */ | 940 | * cache skb */ |
940 | memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, | 941 | skb_copy_from_linear_data_offset(skb, hdrlen, |
941 | flen); | 942 | skb_put(frag_skb, |
943 | flen), flen); | ||
942 | } | 944 | } |
943 | dev_kfree_skb(skb); | 945 | dev_kfree_skb(skb); |
944 | skb = NULL; | 946 | skb = NULL; |
@@ -1044,8 +1046,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
1044 | skb->len >= ETH_HLEN + ETH_ALEN) { | 1046 | skb->len >= ETH_HLEN + ETH_ALEN) { |
1045 | /* Non-standard frame: get addr4 from its bogus location after | 1047 | /* Non-standard frame: get addr4 from its bogus location after |
1046 | * the payload */ | 1048 | * the payload */ |
1047 | memcpy(skb->data + ETH_ALEN, | 1049 | skb_copy_from_linear_data_offset(skb, skb->len - ETH_ALEN, |
1048 | skb->data + skb->len - ETH_ALEN, ETH_ALEN); | 1050 | skb->data + ETH_ALEN, |
1051 | ETH_ALEN); | ||
1049 | skb_trim(skb, skb->len - ETH_ALEN); | 1052 | skb_trim(skb, skb->len - ETH_ALEN); |
1050 | } | 1053 | } |
1051 | 1054 | ||
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 159baef18e4a..246fac0e8001 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -146,7 +146,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
146 | fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS; | 146 | fc |= IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS; |
147 | /* From&To DS: Addr1 = RA, Addr2 = TA, Addr3 = DA, | 147 | /* From&To DS: Addr1 = RA, Addr2 = TA, Addr3 = DA, |
148 | * Addr4 = SA */ | 148 | * Addr4 = SA */ |
149 | memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); | 149 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, |
150 | &hdr.addr4, ETH_ALEN); | ||
150 | hdr_len += ETH_ALEN; | 151 | hdr_len += ETH_ALEN; |
151 | } else { | 152 | } else { |
152 | /* bogus 4-addr format to workaround Prism2 station | 153 | /* bogus 4-addr format to workaround Prism2 station |
@@ -159,7 +160,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
159 | /* SA from skb->data + ETH_ALEN will be added after | 160 | /* SA from skb->data + ETH_ALEN will be added after |
160 | * frame payload; use hdr.addr4 as a temporary buffer | 161 | * frame payload; use hdr.addr4 as a temporary buffer |
161 | */ | 162 | */ |
162 | memcpy(&hdr.addr4, skb->data + ETH_ALEN, ETH_ALEN); | 163 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, |
164 | &hdr.addr4, ETH_ALEN); | ||
163 | need_tailroom += ETH_ALEN; | 165 | need_tailroom += ETH_ALEN; |
164 | } | 166 | } |
165 | 167 | ||
@@ -174,24 +176,27 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
174 | else | 176 | else |
175 | memcpy(&hdr.addr1, local->bssid, ETH_ALEN); | 177 | memcpy(&hdr.addr1, local->bssid, ETH_ALEN); |
176 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); | 178 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); |
177 | memcpy(&hdr.addr3, skb->data, ETH_ALEN); | 179 | skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN); |
178 | } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) { | 180 | } else if (local->iw_mode == IW_MODE_MASTER && !to_assoc_ap) { |
179 | fc |= IEEE80211_FCTL_FROMDS; | 181 | fc |= IEEE80211_FCTL_FROMDS; |
180 | /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */ | 182 | /* From DS: Addr1 = DA, Addr2 = BSSID, Addr3 = SA */ |
181 | memcpy(&hdr.addr1, skb->data, ETH_ALEN); | 183 | skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN); |
182 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); | 184 | memcpy(&hdr.addr2, dev->dev_addr, ETH_ALEN); |
183 | memcpy(&hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); | 185 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr3, |
186 | ETH_ALEN); | ||
184 | } else if (local->iw_mode == IW_MODE_INFRA || to_assoc_ap) { | 187 | } else if (local->iw_mode == IW_MODE_INFRA || to_assoc_ap) { |
185 | fc |= IEEE80211_FCTL_TODS; | 188 | fc |= IEEE80211_FCTL_TODS; |
186 | /* To DS: Addr1 = BSSID, Addr2 = SA, Addr3 = DA */ | 189 | /* To DS: Addr1 = BSSID, Addr2 = SA, Addr3 = DA */ |
187 | memcpy(&hdr.addr1, to_assoc_ap ? | 190 | memcpy(&hdr.addr1, to_assoc_ap ? |
188 | local->assoc_ap_addr : local->bssid, ETH_ALEN); | 191 | local->assoc_ap_addr : local->bssid, ETH_ALEN); |
189 | memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); | 192 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2, |
190 | memcpy(&hdr.addr3, skb->data, ETH_ALEN); | 193 | ETH_ALEN); |
194 | skb_copy_from_linear_data(skb, &hdr.addr3, ETH_ALEN); | ||
191 | } else if (local->iw_mode == IW_MODE_ADHOC) { | 195 | } else if (local->iw_mode == IW_MODE_ADHOC) { |
192 | /* not From/To DS: Addr1 = DA, Addr2 = SA, Addr3 = BSSID */ | 196 | /* not From/To DS: Addr1 = DA, Addr2 = SA, Addr3 = BSSID */ |
193 | memcpy(&hdr.addr1, skb->data, ETH_ALEN); | 197 | skb_copy_from_linear_data(skb, &hdr.addr1, ETH_ALEN); |
194 | memcpy(&hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); | 198 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, &hdr.addr2, |
199 | ETH_ALEN); | ||
195 | memcpy(&hdr.addr3, local->bssid, ETH_ALEN); | 200 | memcpy(&hdr.addr3, local->bssid, ETH_ALEN); |
196 | } | 201 | } |
197 | 202 | ||
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 797d950d5d61..4ca8a27b8c55 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1277,8 +1277,8 @@ static char * ap_auth_make_challenge(struct ap_data *ap) | |||
1277 | return NULL; | 1277 | return NULL; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | memcpy(tmpbuf, skb->data + ap->crypt->extra_mpdu_prefix_len, | 1280 | skb_copy_from_linear_data_offset(skb, ap->crypt->extra_mpdu_prefix_len, |
1281 | WLAN_AUTH_CHALLENGE_LEN); | 1281 | tmpbuf, WLAN_AUTH_CHALLENGE_LEN); |
1282 | dev_kfree_skb(skb); | 1282 | dev_kfree_skb(skb); |
1283 | 1283 | ||
1284 | return tmpbuf; | 1284 | return tmpbuf; |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 9003ff7d151a..fb01fb95a9f0 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -1838,13 +1838,14 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) | |||
1838 | 1838 | ||
1839 | /* skb->data starts with txdesc->frame_control */ | 1839 | /* skb->data starts with txdesc->frame_control */ |
1840 | hdr_len = 24; | 1840 | hdr_len = 24; |
1841 | memcpy(&txdesc.frame_control, skb->data, hdr_len); | 1841 | skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len); |
1842 | fc = le16_to_cpu(txdesc.frame_control); | 1842 | fc = le16_to_cpu(txdesc.frame_control); |
1843 | if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && | 1843 | if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && |
1844 | (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && | 1844 | (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && |
1845 | skb->len >= 30) { | 1845 | skb->len >= 30) { |
1846 | /* Addr4 */ | 1846 | /* Addr4 */ |
1847 | memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN); | 1847 | skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4, |
1848 | ETH_ALEN); | ||
1848 | hdr_len += ETH_ALEN; | 1849 | hdr_len += ETH_ALEN; |
1849 | } | 1850 | } |
1850 | 1851 | ||
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index ad6e4a428355..9137a4dd02eb 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2416,8 +2416,9 @@ static void isr_rx(struct ipw2100_priv *priv, int i, | |||
2416 | #ifdef IPW2100_RX_DEBUG | 2416 | #ifdef IPW2100_RX_DEBUG |
2417 | /* Make a copy of the frame so we can dump it to the logs if | 2417 | /* Make a copy of the frame so we can dump it to the logs if |
2418 | * ieee80211_rx fails */ | 2418 | * ieee80211_rx fails */ |
2419 | memcpy(packet_data, packet->skb->data, | 2419 | skb_copy_from_linear_data(packet->skb, packet_data, |
2420 | min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); | 2420 | min_t(u32, status->frame_size, |
2421 | IPW_RX_NIC_BUFFER_LENGTH)); | ||
2421 | #endif | 2422 | #endif |
2422 | 2423 | ||
2423 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { | 2424 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index b04c56a25cc5..4839a45098cb 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -10355,7 +10355,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, | |||
10355 | 10355 | ||
10356 | rt_hdr->it_len = dst->len; | 10356 | rt_hdr->it_len = dst->len; |
10357 | 10357 | ||
10358 | memcpy(skb_put(dst, len), src->data, len); | 10358 | skb_copy_from_linear_data(src, skb_put(dst, len), len); |
10359 | 10359 | ||
10360 | if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) | 10360 | if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) |
10361 | dev_kfree_skb_any(dst); | 10361 | dev_kfree_skb_any(dst); |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 6ebfff034242..7d8bff1dbc4d 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -162,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | |||
162 | 162 | ||
163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); | 163 | skb_put(newskb, init_wds ? skb->len + 6 : skb->len); |
164 | if (init_wds) { | 164 | if (init_wds) { |
165 | memcpy(newskb->data + 6, skb->data, skb->len); | 165 | skb_copy_from_linear_data(skb, |
166 | newskb->data + 6, | ||
167 | skb->len); | ||
166 | memcpy(newskb->data, wds_mac, 6); | 168 | memcpy(newskb->data, wds_mac, 6); |
167 | #ifdef ISLPCI_ETH_DEBUG | 169 | #ifdef ISLPCI_ETH_DEBUG |
168 | printk("islpci_eth_transmit:wds_mac\n"); | 170 | printk("islpci_eth_transmit:wds_mac\n"); |
169 | #endif | 171 | #endif |
170 | } else | 172 | } else |
171 | memcpy(newskb->data, skb->data, skb->len); | 173 | skb_copy_from_linear_data(skb, newskb->data, |
174 | skb->len); | ||
172 | 175 | ||
173 | #if VERBOSE > SHOW_ERROR_MESSAGES | 176 | #if VERBOSE > SHOW_ERROR_MESSAGES |
174 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", | 177 | DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", |
@@ -394,8 +397,10 @@ islpci_eth_receive(islpci_private *priv) | |||
394 | /* Update spy records */ | 397 | /* Update spy records */ |
395 | wireless_spy_update(ndev, annex->addr2, &wstats); | 398 | wireless_spy_update(ndev, annex->addr2, &wstats); |
396 | 399 | ||
397 | memcpy(skb->data + sizeof (struct rfmon_header), | 400 | skb_copy_from_linear_data(skb, |
398 | skb->data, 2 * ETH_ALEN); | 401 | (skb->data + |
402 | sizeof(struct rfmon_header)), | ||
403 | 2 * ETH_ALEN); | ||
399 | skb_pull(skb, sizeof (struct rfmon_header)); | 404 | skb_pull(skb, sizeof (struct rfmon_header)); |
400 | } | 405 | } |
401 | skb->protocol = eth_type_trans(skb, ndev); | 406 | skb->protocol = eth_type_trans(skb, ndev); |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 9633b0457f8c..3be624295a1f 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -2242,7 +2242,8 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned i | |||
2242 | rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len); | 2242 | rx_ptr += copy_from_rx_buff(local, rx_ptr, pkt_addr & RX_BUFF_END, rx_len); |
2243 | /* Get source address */ | 2243 | /* Get source address */ |
2244 | #ifdef WIRELESS_SPY | 2244 | #ifdef WIRELESS_SPY |
2245 | memcpy(linksrcaddr, ((struct mac_header *)skb->data)->addr_2, ETH_ALEN); | 2245 | skb_copy_from_linear_data_offset(skb, offsetof(struct mac_header, addr_2), |
2246 | linksrcaddr, ETH_ALEN); | ||
2246 | #endif | 2247 | #endif |
2247 | /* Now, deal with encapsulation/translation/sniffer */ | 2248 | /* Now, deal with encapsulation/translation/sniffer */ |
2248 | if (!sniffer) { | 2249 | if (!sniffer) { |
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index 2bf77b1ee531..1cf090d60edc 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -2938,7 +2938,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) | |||
2938 | * need to pad. Jean II */ | 2938 | * need to pad. Jean II */ |
2939 | if (skb->len < ETH_ZLEN) { | 2939 | if (skb->len < ETH_ZLEN) { |
2940 | memset(data, 0, ETH_ZLEN); | 2940 | memset(data, 0, ETH_ZLEN); |
2941 | memcpy(data, skb->data, skb->len); | 2941 | skb_copy_from_linear_data(skb, data, skb->len); |
2942 | /* Write packet on the card */ | 2942 | /* Write packet on the card */ |
2943 | if(wv_packet_write(dev, data, ETH_ZLEN)) | 2943 | if(wv_packet_write(dev, data, ETH_ZLEN)) |
2944 | return 1; /* We failed */ | 2944 | return 1; /* We failed */ |
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 1fe013a7297a..935b144d9b56 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -807,10 +807,10 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
807 | txbuf[4] = 0x00; | 807 | txbuf[4] = 0x00; |
808 | txbuf[5] = 0x00; | 808 | txbuf[5] = 0x00; |
809 | 809 | ||
810 | memcpy(txbuf+6, skb->data+12, skb->len-12); | 810 | skb_copy_from_linear_data_offset(skb, 12, txbuf + 6, skb->len - 12); |
811 | if (pad) | 811 | if (pad) |
812 | txbuf[skb->len-12+6]=0; | 812 | txbuf[skb->len-12+6]=0; |
813 | memcpy(txbuf+skb->len-12+6+pad, skb->data, 12); | 813 | skb_copy_from_linear_data(skb, txbuf + skb->len - 12 + 6 + pad, 12); |
814 | *(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6); | 814 | *(__be16*)&txbuf[skb->len+6+pad] = htons(skb->len-12+6); |
815 | txbuf[txbuflen-1] = 0; | 815 | txbuf[txbuflen-1] = 0; |
816 | 816 | ||
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index 54e3f806cd52..b0f813e6f48e 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
@@ -472,7 +472,8 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb) | |||
472 | privptr->stats.rx_dropped++; | 472 | privptr->stats.rx_dropped++; |
473 | return; | 473 | return; |
474 | } | 474 | } |
475 | memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); | 475 | skb_copy_from_linear_data(pskb, skb_put(skb, pskb->len), |
476 | pskb->len); | ||
476 | skb_reset_mac_header(skb); | 477 | skb_reset_mac_header(skb); |
477 | skb->dev = pskb->dev; | 478 | skb->dev = pskb->dev; |
478 | skb->protocol = pskb->protocol; | 479 | skb->protocol = pskb->protocol; |
@@ -716,8 +717,9 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) | |||
716 | *((__u16 *) skb_put(ch->trans_skb, 2)) = ch->collect_len + 2; | 717 | *((__u16 *) skb_put(ch->trans_skb, 2)) = ch->collect_len + 2; |
717 | i = 0; | 718 | i = 0; |
718 | while ((skb = skb_dequeue(&ch->collect_queue))) { | 719 | while ((skb = skb_dequeue(&ch->collect_queue))) { |
719 | memcpy(skb_put(ch->trans_skb, skb->len), skb->data, | 720 | skb_copy_from_linear_data(skb, skb_put(ch->trans_skb, |
720 | skb->len); | 721 | skb->len), |
722 | skb->len); | ||
721 | privptr->stats.tx_packets++; | 723 | privptr->stats.tx_packets++; |
722 | privptr->stats.tx_bytes += skb->len - LL_HEADER_LENGTH; | 724 | privptr->stats.tx_bytes += skb->len - LL_HEADER_LENGTH; |
723 | atomic_dec(&skb->users); | 725 | atomic_dec(&skb->users); |
@@ -2268,8 +2270,9 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) | |||
2268 | skb_reset_tail_pointer(ch->trans_skb); | 2270 | skb_reset_tail_pointer(ch->trans_skb); |
2269 | ch->trans_skb->len = 0; | 2271 | ch->trans_skb->len = 0; |
2270 | ch->ccw[1].count = skb->len; | 2272 | ch->ccw[1].count = skb->len; |
2271 | memcpy(skb_put(ch->trans_skb, skb->len), skb->data, | 2273 | skb_copy_from_linear_data(skb, skb_put(ch->trans_skb, |
2272 | skb->len); | 2274 | skb->len), |
2275 | skb->len); | ||
2273 | atomic_dec(&skb->users); | 2276 | atomic_dec(&skb->users); |
2274 | dev_kfree_skb_irq(skb); | 2277 | dev_kfree_skb_irq(skb); |
2275 | ccw_idx = 0; | 2278 | ccw_idx = 0; |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 1c23e187a3ba..08a994fdd1a4 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1576,7 +1576,7 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb, | |||
1576 | header->offset = card->tx_buffer->count; | 1576 | header->offset = card->tx_buffer->count; |
1577 | header->type = card->lan_type; | 1577 | header->type = card->lan_type; |
1578 | header->slot = card->portno; | 1578 | header->slot = card->portno; |
1579 | memcpy(header + 1, skb->data, skb->len); | 1579 | skb_copy_from_linear_data(skb, header + 1, skb->len); |
1580 | spin_unlock(&card->lock); | 1580 | spin_unlock(&card->lock); |
1581 | card->stats.tx_bytes += skb->len; | 1581 | card->stats.tx_bytes += skb->len; |
1582 | card->stats.tx_packets++; | 1582 | card->stats.tx_packets++; |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index cd42bd54988c..e10e85e85c84 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -645,7 +645,8 @@ static void netiucv_unpack_skb(struct iucv_connection *conn, | |||
645 | privptr->stats.rx_dropped++; | 645 | privptr->stats.rx_dropped++; |
646 | return; | 646 | return; |
647 | } | 647 | } |
648 | memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); | 648 | skb_copy_from_linear_data(pskb, skb_put(skb, pskb->len), |
649 | pskb->len); | ||
649 | skb_reset_mac_header(skb); | 650 | skb_reset_mac_header(skb); |
650 | skb->dev = pskb->dev; | 651 | skb->dev = pskb->dev; |
651 | skb->protocol = pskb->protocol; | 652 | skb->protocol = pskb->protocol; |
@@ -744,7 +745,9 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) | |||
744 | header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; | 745 | header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; |
745 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, | 746 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, |
746 | NETIUCV_HDRLEN); | 747 | NETIUCV_HDRLEN); |
747 | memcpy(skb_put(conn->tx_buff, skb->len), skb->data, skb->len); | 748 | skb_copy_from_linear_data(skb, |
749 | skb_put(conn->tx_buff, skb->len), | ||
750 | skb->len); | ||
748 | txbytes += skb->len; | 751 | txbytes += skb->len; |
749 | txpackets++; | 752 | txpackets++; |
750 | stat_maxcq++; | 753 | stat_maxcq++; |
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 5890bb5ad23e..dd7034fbfff8 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c | |||
@@ -267,7 +267,8 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, | |||
267 | 267 | ||
268 | QETH_DBF_TEXT(trace, 5, "eddpcdtc"); | 268 | QETH_DBF_TEXT(trace, 5, "eddpcdtc"); |
269 | if (skb_shinfo(eddp->skb)->nr_frags == 0) { | 269 | if (skb_shinfo(eddp->skb)->nr_frags == 0) { |
270 | memcpy(dst, eddp->skb->data + eddp->skb_offset, len); | 270 | skb_copy_from_linear_data_offset(eddp->skb, eddp->skb_offset, |
271 | dst, len); | ||
271 | *hcsum = csum_partial(eddp->skb->data + eddp->skb_offset, len, | 272 | *hcsum = csum_partial(eddp->skb->data + eddp->skb_offset, len, |
272 | *hcsum); | 273 | *hcsum); |
273 | eddp->skb_offset += len; | 274 | eddp->skb_offset += len; |
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index a076f735a7bc..d287c5755229 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -484,7 +484,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
484 | ptr[4] = 0xec; | 484 | ptr[4] = 0xec; |
485 | ptr += ATM_CELL_HEADER; | 485 | ptr += ATM_CELL_HEADER; |
486 | 486 | ||
487 | memcpy(ptr, skb->data, data_len); | 487 | skb_copy_from_linear_data(skb, ptr, data_len); |
488 | ptr += data_len; | 488 | ptr += data_len; |
489 | __skb_pull(skb, data_len); | 489 | __skb_pull(skb, data_len); |
490 | 490 | ||
diff --git a/drivers/usb/net/catc.c b/drivers/usb/net/catc.c index d82022dd7f2e..ffec2e01b896 100644 --- a/drivers/usb/net/catc.c +++ b/drivers/usb/net/catc.c | |||
@@ -418,7 +418,7 @@ static int catc_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
418 | catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6; | 418 | catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6; |
419 | tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr; | 419 | tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr; |
420 | *((u16*)tx_buf) = (catc->is_f5u011) ? cpu_to_be16((u16)skb->len) : cpu_to_le16((u16)skb->len); | 420 | *((u16*)tx_buf) = (catc->is_f5u011) ? cpu_to_be16((u16)skb->len) : cpu_to_le16((u16)skb->len); |
421 | memcpy(tx_buf + 2, skb->data, skb->len); | 421 | skb_copy_from_linear_data(skb, tx_buf + 2, skb->len); |
422 | catc->tx_ptr += skb->len + 2; | 422 | catc->tx_ptr += skb->len + 2; |
423 | 423 | ||
424 | if (!test_and_set_bit(TX_RUNNING, &catc->flags)) | 424 | if (!test_and_set_bit(TX_RUNNING, &catc->flags)) |
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index 13f70e09ea40..1ad4ee54b186 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -889,7 +889,7 @@ static int pegasus_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
889 | netif_stop_queue(net); | 889 | netif_stop_queue(net); |
890 | 890 | ||
891 | ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16); | 891 | ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16); |
892 | memcpy(pegasus->tx_buff + 2, skb->data, skb->len); | 892 | skb_copy_from_linear_data(skb, pegasus->tx_buff + 2, skb->len); |
893 | usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb, | 893 | usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb, |
894 | usb_sndbulkpipe(pegasus->usb, 2), | 894 | usb_sndbulkpipe(pegasus->usb, 2), |
895 | pegasus->tx_buff, count, | 895 | pegasus->tx_buff, count, |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1c19b2d55c2b..08c96bcbc59c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1507,6 +1507,20 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | |||
1507 | return buffer; | 1507 | return buffer; |
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | static inline void skb_copy_from_linear_data(const struct sk_buff *skb, | ||
1511 | void *to, | ||
1512 | const unsigned int len) | ||
1513 | { | ||
1514 | memcpy(to, skb->data, len); | ||
1515 | } | ||
1516 | |||
1517 | static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb, | ||
1518 | const int offset, void *to, | ||
1519 | const unsigned int len) | ||
1520 | { | ||
1521 | memcpy(to, skb->data + offset, len); | ||
1522 | } | ||
1523 | |||
1510 | extern void skb_init(void); | 1524 | extern void skb_init(void); |
1511 | 1525 | ||
1512 | /** | 1526 | /** |
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c index e66953ce53e7..92b517af7260 100644 --- a/net/ax25/ax25_out.c +++ b/net/ax25/ax25_out.c | |||
@@ -150,7 +150,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb) | |||
150 | skb_reserve(skbn, frontlen + 2); | 150 | skb_reserve(skbn, frontlen + 2); |
151 | skb_set_network_header(skbn, | 151 | skb_set_network_header(skbn, |
152 | skb_network_offset(skb)); | 152 | skb_network_offset(skb)); |
153 | memcpy(skb_put(skbn, len), skb->data, len); | 153 | skb_copy_from_linear_data(skb, skb_put(skbn, len), len); |
154 | p = skb_push(skbn, 2); | 154 | p = skb_push(skbn, 2); |
155 | 155 | ||
156 | *p++ = AX25_P_SEGMENT; | 156 | *p++ = AX25_P_SEGMENT; |
@@ -164,7 +164,7 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb) | |||
164 | skb_reserve(skbn, frontlen + 1); | 164 | skb_reserve(skbn, frontlen + 1); |
165 | skb_set_network_header(skbn, | 165 | skb_set_network_header(skbn, |
166 | skb_network_offset(skb)); | 166 | skb_network_offset(skb)); |
167 | memcpy(skb_put(skbn, len), skb->data, len); | 167 | skb_copy_from_linear_data(skb, skb_put(skbn, len), len); |
168 | p = skb_push(skbn, 1); | 168 | p = skb_push(skbn, 1); |
169 | *p = AX25_P_TEXT; | 169 | *p = AX25_P_TEXT; |
170 | } | 170 | } |
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index 97156c4abc8d..ab2db55982ca 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -382,7 +382,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb) | |||
382 | break; | 382 | break; |
383 | } | 383 | } |
384 | 384 | ||
385 | memcpy(__skb_put(nskb, skb->len), skb->data, skb->len); | 385 | skb_copy_from_linear_data(skb, __skb_put(nskb, skb->len), skb->len); |
386 | kfree_skb(skb); | 386 | kfree_skb(skb); |
387 | 387 | ||
388 | s->stats.rx_packets++; | 388 | s->stats.rx_packets++; |
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 3933608a9296..66bef1ccee2a 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
@@ -124,7 +124,7 @@ static inline void cmtp_add_msgpart(struct cmtp_session *session, int id, const | |||
124 | } | 124 | } |
125 | 125 | ||
126 | if (skb && (skb->len > 0)) | 126 | if (skb && (skb->len > 0)) |
127 | memcpy(skb_put(nskb, skb->len), skb->data, skb->len); | 127 | skb_copy_from_linear_data(skb, skb_put(nskb, skb->len), skb->len); |
128 | 128 | ||
129 | memcpy(skb_put(nskb, count), buf, count); | 129 | memcpy(skb_put(nskb, count), buf, count); |
130 | 130 | ||
@@ -256,7 +256,7 @@ static void cmtp_process_transmit(struct cmtp_session *session) | |||
256 | hdr[2] = size >> 8; | 256 | hdr[2] = size >> 8; |
257 | } | 257 | } |
258 | 258 | ||
259 | memcpy(skb_put(nskb, size), skb->data, size); | 259 | skb_copy_from_linear_data(skb, skb_put(nskb, size), size); |
260 | skb_pull(skb, size); | 260 | skb_pull(skb, size); |
261 | 261 | ||
262 | if (skb->len > 0) { | 262 | if (skb->len > 0) { |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 162eab6a4478..a5867879b615 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2107,7 +2107,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl | |||
2107 | if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC))) | 2107 | if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC))) |
2108 | goto drop; | 2108 | goto drop; |
2109 | 2109 | ||
2110 | memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len); | 2110 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), |
2111 | skb->len); | ||
2111 | conn->rx_len = len - skb->len; | 2112 | conn->rx_len = len - skb->len; |
2112 | } else { | 2113 | } else { |
2113 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); | 2114 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); |
@@ -2128,7 +2129,8 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl | |||
2128 | goto drop; | 2129 | goto drop; |
2129 | } | 2130 | } |
2130 | 2131 | ||
2131 | memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len); | 2132 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), |
2133 | skb->len); | ||
2132 | conn->rx_len -= skb->len; | 2134 | conn->rx_len -= skb->len; |
2133 | 2135 | ||
2134 | if (!conn->rx_len) { | 2136 | if (!conn->rx_len) { |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 8cee7fdc16c3..8b45224699f4 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -129,7 +129,8 @@ static inline void nf_bridge_save_header(struct sk_buff *skb) | |||
129 | if (skb->protocol == htons(ETH_P_8021Q)) | 129 | if (skb->protocol == htons(ETH_P_8021Q)) |
130 | header_size += VLAN_HLEN; | 130 | header_size += VLAN_HLEN; |
131 | 131 | ||
132 | memcpy(skb->nf_bridge->data, skb->data - header_size, header_size); | 132 | skb_copy_from_linear_data_offset(skb, -header_size, |
133 | skb->nf_bridge->data, header_size); | ||
133 | } | 134 | } |
134 | 135 | ||
135 | /* | 136 | /* |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f16c72204cf6..17c6bb5927b6 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -576,7 +576,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask) | |||
576 | /* Set the tail pointer and length */ | 576 | /* Set the tail pointer and length */ |
577 | skb_put(n, skb_headlen(skb)); | 577 | skb_put(n, skb_headlen(skb)); |
578 | /* Copy the bytes */ | 578 | /* Copy the bytes */ |
579 | memcpy(n->data, skb->data, n->len); | 579 | skb_copy_from_linear_data(skb, n->data, n->len); |
580 | n->csum = skb->csum; | 580 | n->csum = skb->csum; |
581 | n->ip_summed = skb->ip_summed; | 581 | n->ip_summed = skb->ip_summed; |
582 | 582 | ||
@@ -1043,7 +1043,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len) | |||
1043 | if ((copy = start - offset) > 0) { | 1043 | if ((copy = start - offset) > 0) { |
1044 | if (copy > len) | 1044 | if (copy > len) |
1045 | copy = len; | 1045 | copy = len; |
1046 | memcpy(to, skb->data + offset, copy); | 1046 | skb_copy_from_linear_data_offset(skb, offset, to, copy); |
1047 | if ((len -= copy) == 0) | 1047 | if ((len -= copy) == 0) |
1048 | return 0; | 1048 | return 0; |
1049 | offset += copy; | 1049 | offset += copy; |
@@ -1362,7 +1362,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to) | |||
1362 | 1362 | ||
1363 | BUG_ON(csstart > skb_headlen(skb)); | 1363 | BUG_ON(csstart > skb_headlen(skb)); |
1364 | 1364 | ||
1365 | memcpy(to, skb->data, csstart); | 1365 | skb_copy_from_linear_data(skb, to, csstart); |
1366 | 1366 | ||
1367 | csum = 0; | 1367 | csum = 0; |
1368 | if (csstart != skb->len) | 1368 | if (csstart != skb->len) |
@@ -1536,8 +1536,8 @@ static inline void skb_split_inside_header(struct sk_buff *skb, | |||
1536 | { | 1536 | { |
1537 | int i; | 1537 | int i; |
1538 | 1538 | ||
1539 | memcpy(skb_put(skb1, pos - len), skb->data + len, pos - len); | 1539 | skb_copy_from_linear_data_offset(skb, len, skb_put(skb1, pos - len), |
1540 | 1540 | pos - len); | |
1541 | /* And move data appendix as is. */ | 1541 | /* And move data appendix as is. */ |
1542 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) | 1542 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) |
1543 | skb_shinfo(skb1)->frags[i] = skb_shinfo(skb)->frags[i]; | 1543 | skb_shinfo(skb1)->frags[i] = skb_shinfo(skb)->frags[i]; |
@@ -1927,8 +1927,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
1927 | skb_set_network_header(nskb, skb->mac_len); | 1927 | skb_set_network_header(nskb, skb->mac_len); |
1928 | nskb->transport_header = (nskb->network_header + | 1928 | nskb->transport_header = (nskb->network_header + |
1929 | skb_network_header_len(skb)); | 1929 | skb_network_header_len(skb)); |
1930 | memcpy(skb_put(nskb, doffset), skb->data, doffset); | 1930 | skb_copy_from_linear_data(skb, skb_put(nskb, doffset), |
1931 | 1931 | doffset); | |
1932 | if (!sg) { | 1932 | if (!sg) { |
1933 | nskb->csum = skb_copy_and_csum_bits(skb, offset, | 1933 | nskb->csum = skb_copy_and_csum_bits(skb, offset, |
1934 | skb_put(nskb, len), | 1934 | skb_put(nskb, len), |
@@ -1941,7 +1941,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
1941 | 1941 | ||
1942 | nskb->ip_summed = CHECKSUM_PARTIAL; | 1942 | nskb->ip_summed = CHECKSUM_PARTIAL; |
1943 | nskb->csum = skb->csum; | 1943 | nskb->csum = skb->csum; |
1944 | memcpy(skb_put(nskb, hsize), skb->data + offset, hsize); | 1944 | skb_copy_from_linear_data_offset(skb, offset, |
1945 | skb_put(nskb, hsize), hsize); | ||
1945 | 1946 | ||
1946 | while (pos < offset + len) { | 1947 | while (pos < offset + len) { |
1947 | BUG_ON(i >= nfrags); | 1948 | BUG_ON(i >= nfrags); |
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index d9498a165acf..4074a6e5d0de 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -362,7 +362,8 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
362 | u16 dlen = *skb->data; | 362 | u16 dlen = *skb->data; |
363 | if ((dlen <= 16) && (dlen <= skb->len)) { | 363 | if ((dlen <= 16) && (dlen <= skb->len)) { |
364 | scp->conndata_in.opt_optl = dn_htons(dlen); | 364 | scp->conndata_in.opt_optl = dn_htons(dlen); |
365 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); | 365 | skb_copy_from_linear_data_offset(skb, 1, |
366 | scp->conndata_in.opt_data, dlen); | ||
366 | } | 367 | } |
367 | } | 368 | } |
368 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); | 369 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); |
@@ -406,7 +407,7 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) | |||
406 | u16 dlen = *skb->data; | 407 | u16 dlen = *skb->data; |
407 | if ((dlen <= 16) && (dlen <= skb->len)) { | 408 | if ((dlen <= 16) && (dlen <= skb->len)) { |
408 | scp->discdata_in.opt_optl = dn_htons(dlen); | 409 | scp->discdata_in.opt_optl = dn_htons(dlen); |
409 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); | 410 | skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen); |
410 | } | 411 | } |
411 | } | 412 | } |
412 | 413 | ||
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index ec6d8851a061..4eb35079e434 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
@@ -152,7 +152,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
152 | return -1; | 152 | return -1; |
153 | 153 | ||
154 | /* Copy the IV into the first 3 bytes of the key */ | 154 | /* Copy the IV into the first 3 bytes of the key */ |
155 | memcpy(key, skb->data + hdr_len, 3); | 155 | skb_copy_from_linear_data_offset(skb, hdr_len, key, 3); |
156 | 156 | ||
157 | /* Copy rest of the WEP key (the secret part) */ | 157 | /* Copy rest of the WEP key (the secret part) */ |
158 | memcpy(key + 3, wep->key, wep->key_len); | 158 | memcpy(key + 3, wep->key, wep->key_len); |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 59a765c49cf9..94e2b8e2ab26 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -606,12 +606,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
606 | if (frag == 0) { | 606 | if (frag == 0) { |
607 | /* copy first fragment (including full headers) into | 607 | /* copy first fragment (including full headers) into |
608 | * beginning of the fragment cache skb */ | 608 | * beginning of the fragment cache skb */ |
609 | memcpy(skb_put(frag_skb, flen), skb->data, flen); | 609 | skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), flen); |
610 | } else { | 610 | } else { |
611 | /* append frame payload to the end of the fragment | 611 | /* append frame payload to the end of the fragment |
612 | * cache skb */ | 612 | * cache skb */ |
613 | memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, | 613 | skb_copy_from_linear_data_offset(skb, hdrlen, |
614 | flen); | 614 | skb_put(frag_skb, flen), flen); |
615 | } | 615 | } |
616 | dev_kfree_skb_any(skb); | 616 | dev_kfree_skb_any(skb); |
617 | skb = NULL; | 617 | skb = NULL; |
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 62a8a2b76539..a4c3c51140a3 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -309,8 +309,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | /* Save source and destination addresses */ | 311 | /* Save source and destination addresses */ |
312 | memcpy(dest, skb->data, ETH_ALEN); | 312 | skb_copy_from_linear_data(skb, dest, ETH_ALEN); |
313 | memcpy(src, skb->data + ETH_ALEN, ETH_ALEN); | 313 | skb_copy_from_linear_data_offset(skb, ETH_ALEN, src, ETH_ALEN); |
314 | 314 | ||
315 | if (host_encrypt || host_build_iv) | 315 | if (host_encrypt || host_build_iv) |
316 | fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | | 316 | fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | |
@@ -363,7 +363,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
363 | snapped = 1; | 363 | snapped = 1; |
364 | ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)), | 364 | ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)), |
365 | ether_type); | 365 | ether_type); |
366 | memcpy(skb_put(skb_new, skb->len), skb->data, skb->len); | 366 | skb_copy_from_linear_data(skb, skb_put(skb_new, skb->len), skb->len); |
367 | res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv); | 367 | res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv); |
368 | if (res < 0) { | 368 | if (res < 0) { |
369 | IEEE80211_ERROR("msdu encryption failed\n"); | 369 | IEEE80211_ERROR("msdu encryption failed\n"); |
@@ -492,7 +492,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
492 | bytes -= SNAP_SIZE + sizeof(u16); | 492 | bytes -= SNAP_SIZE + sizeof(u16); |
493 | } | 493 | } |
494 | 494 | ||
495 | memcpy(skb_put(skb_frag, bytes), skb->data, bytes); | 495 | skb_copy_from_linear_data(skb, skb_put(skb_frag, bytes), bytes); |
496 | 496 | ||
497 | /* Advance the SKB... */ | 497 | /* Advance the SKB... */ |
498 | skb_pull(skb, bytes); | 498 | skb_pull(skb, bytes); |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 875da382d9b9..34606eff8a05 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -596,7 +596,7 @@ slow_path: | |||
596 | * Copy the packet header into the new buffer. | 596 | * Copy the packet header into the new buffer. |
597 | */ | 597 | */ |
598 | 598 | ||
599 | memcpy(skb_network_header(skb2), skb->data, hlen); | 599 | skb_copy_from_linear_data(skb, skb_network_header(skb2), hlen); |
600 | 600 | ||
601 | /* | 601 | /* |
602 | * Copy a block of the IP datagram. | 602 | * Copy a block of the IP datagram. |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index be3f082a87ed..4cfdad4e8356 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -746,7 +746,7 @@ slow_path: | |||
746 | /* | 746 | /* |
747 | * Copy the packet header into the new buffer. | 747 | * Copy the packet header into the new buffer. |
748 | */ | 748 | */ |
749 | memcpy(skb_network_header(frag), skb->data, hlen); | 749 | skb_copy_from_linear_data(skb, skb_network_header(frag), hlen); |
750 | 750 | ||
751 | /* | 751 | /* |
752 | * Build fragment header. | 752 | * Build fragment header. |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index da3f2bc1b6f6..b55bc8f989df 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -314,8 +314,8 @@ static inline void irttp_fragment_skb(struct tsap_cb *self, | |||
314 | skb_reserve(frag, self->max_header_size); | 314 | skb_reserve(frag, self->max_header_size); |
315 | 315 | ||
316 | /* Copy data from the original skb into this fragment. */ | 316 | /* Copy data from the original skb into this fragment. */ |
317 | memcpy(skb_put(frag, self->max_seg_size), skb->data, | 317 | skb_copy_from_linear_data(skb, skb_put(frag, self->max_seg_size), |
318 | self->max_seg_size); | 318 | self->max_seg_size); |
319 | 319 | ||
320 | /* Insert TTP header, with the more bit set */ | 320 | /* Insert TTP header, with the more bit set */ |
321 | frame = skb_push(frag, TTP_HEADER); | 321 | frame = skb_push(frag, TTP_HEADER); |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 053fa26ff90a..5dc7448925db 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1160,7 +1160,8 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1160 | 1160 | ||
1161 | if (sax != NULL) { | 1161 | if (sax != NULL) { |
1162 | sax->sax25_family = AF_NETROM; | 1162 | sax->sax25_family = AF_NETROM; |
1163 | memcpy(sax->sax25_call.ax25_call, skb->data + 7, AX25_ADDR_LEN); | 1163 | skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call, |
1164 | AX25_ADDR_LEN); | ||
1164 | } | 1165 | } |
1165 | 1166 | ||
1166 | msg->msg_namelen = sizeof(*sax); | 1167 | msg->msg_namelen = sizeof(*sax); |
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c index 99fdab16ded0..f324d5df4186 100644 --- a/net/netrom/nr_loopback.c +++ b/net/netrom/nr_loopback.c | |||
@@ -34,7 +34,7 @@ int nr_loopback_queue(struct sk_buff *skb) | |||
34 | struct sk_buff *skbn; | 34 | struct sk_buff *skbn; |
35 | 35 | ||
36 | if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) { | 36 | if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) { |
37 | memcpy(skb_put(skbn, skb->len), skb->data, skb->len); | 37 | skb_copy_from_linear_data(skb, skb_put(skbn, skb->len), skb->len); |
38 | skb_reset_transport_header(skbn); | 38 | skb_reset_transport_header(skbn); |
39 | 39 | ||
40 | skb_queue_tail(&loopback_queue, skbn); | 40 | skb_queue_tail(&loopback_queue, skbn); |
diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c index 0cbfb611465b..7c467c95c7d6 100644 --- a/net/netrom/nr_out.c +++ b/net/netrom/nr_out.c | |||
@@ -40,7 +40,7 @@ void nr_output(struct sock *sk, struct sk_buff *skb) | |||
40 | 40 | ||
41 | if (skb->len - NR_TRANSPORT_LEN > NR_MAX_PACKET_SIZE) { | 41 | if (skb->len - NR_TRANSPORT_LEN > NR_MAX_PACKET_SIZE) { |
42 | /* Save a copy of the Transport Header */ | 42 | /* Save a copy of the Transport Header */ |
43 | memcpy(transport, skb->data, NR_TRANSPORT_LEN); | 43 | skb_copy_from_linear_data(skb, transport, NR_TRANSPORT_LEN); |
44 | skb_pull(skb, NR_TRANSPORT_LEN); | 44 | skb_pull(skb, NR_TRANSPORT_LEN); |
45 | 45 | ||
46 | frontlen = skb_headroom(skb); | 46 | frontlen = skb_headroom(skb); |
@@ -54,7 +54,7 @@ void nr_output(struct sock *sk, struct sk_buff *skb) | |||
54 | len = (NR_MAX_PACKET_SIZE > skb->len) ? skb->len : NR_MAX_PACKET_SIZE; | 54 | len = (NR_MAX_PACKET_SIZE > skb->len) ? skb->len : NR_MAX_PACKET_SIZE; |
55 | 55 | ||
56 | /* Copy the user data */ | 56 | /* Copy the user data */ |
57 | memcpy(skb_put(skbn, len), skb->data, len); | 57 | skb_copy_from_linear_data(skb, skb_put(skbn, len), len); |
58 | skb_pull(skb, len); | 58 | skb_pull(skb, len); |
59 | 59 | ||
60 | /* Duplicate the Transport Header */ | 60 | /* Duplicate the Transport Header */ |
diff --git a/net/netrom/nr_subr.c b/net/netrom/nr_subr.c index 07b694d18870..04e7d0d2fd8f 100644 --- a/net/netrom/nr_subr.c +++ b/net/netrom/nr_subr.c | |||
@@ -226,13 +226,13 @@ void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags) | |||
226 | 226 | ||
227 | dptr = skb_put(skbn, NR_NETWORK_LEN + NR_TRANSPORT_LEN); | 227 | dptr = skb_put(skbn, NR_NETWORK_LEN + NR_TRANSPORT_LEN); |
228 | 228 | ||
229 | memcpy(dptr, skb->data + 7, AX25_ADDR_LEN); | 229 | skb_copy_from_linear_data_offset(skb, 7, dptr, AX25_ADDR_LEN); |
230 | dptr[6] &= ~AX25_CBIT; | 230 | dptr[6] &= ~AX25_CBIT; |
231 | dptr[6] &= ~AX25_EBIT; | 231 | dptr[6] &= ~AX25_EBIT; |
232 | dptr[6] |= AX25_SSSID_SPARE; | 232 | dptr[6] |= AX25_SSSID_SPARE; |
233 | dptr += AX25_ADDR_LEN; | 233 | dptr += AX25_ADDR_LEN; |
234 | 234 | ||
235 | memcpy(dptr, skb->data + 0, AX25_ADDR_LEN); | 235 | skb_copy_from_linear_data(skb, dptr, AX25_ADDR_LEN); |
236 | dptr[6] &= ~AX25_CBIT; | 236 | dptr[6] &= ~AX25_CBIT; |
237 | dptr[6] |= AX25_EBIT; | 237 | dptr[6] |= AX25_EBIT; |
238 | dptr[6] |= AX25_SSSID_SPARE; | 238 | dptr[6] |= AX25_SSSID_SPARE; |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 1511697b22ba..f38c3b3471ee 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1156,7 +1156,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1156 | int lg; | 1156 | int lg; |
1157 | 1157 | ||
1158 | /* Save a copy of the Header */ | 1158 | /* Save a copy of the Header */ |
1159 | memcpy(header, skb->data, ROSE_MIN_LEN); | 1159 | skb_copy_from_linear_data(skb, header, ROSE_MIN_LEN); |
1160 | skb_pull(skb, ROSE_MIN_LEN); | 1160 | skb_pull(skb, ROSE_MIN_LEN); |
1161 | 1161 | ||
1162 | frontlen = skb_headroom(skb); | 1162 | frontlen = skb_headroom(skb); |
@@ -1176,7 +1176,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1176 | lg = (ROSE_PACLEN > skb->len) ? skb->len : ROSE_PACLEN; | 1176 | lg = (ROSE_PACLEN > skb->len) ? skb->len : ROSE_PACLEN; |
1177 | 1177 | ||
1178 | /* Copy the user data */ | 1178 | /* Copy the user data */ |
1179 | memcpy(skb_put(skbn, lg), skb->data, lg); | 1179 | skb_copy_from_linear_data(skb, skb_put(skbn, lg), lg); |
1180 | skb_pull(skb, lg); | 1180 | skb_pull(skb, lg); |
1181 | 1181 | ||
1182 | /* Duplicate the Header */ | 1182 | /* Duplicate the Header */ |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index adcda8ebee9c..0d6002fc77b2 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -951,7 +951,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, | |||
951 | * Incoming Call User Data. | 951 | * Incoming Call User Data. |
952 | */ | 952 | */ |
953 | if (skb->len >= 0) { | 953 | if (skb->len >= 0) { |
954 | memcpy(makex25->calluserdata.cuddata, skb->data, skb->len); | 954 | skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len); |
955 | makex25->calluserdata.cudlength = skb->len; | 955 | makex25->calluserdata.cudlength = skb->len; |
956 | } | 956 | } |
957 | 957 | ||
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index b2bbe552a89d..ba13248aa1c3 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c | |||
@@ -112,8 +112,9 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
112 | * Copy any Call User Data. | 112 | * Copy any Call User Data. |
113 | */ | 113 | */ |
114 | if (skb->len >= 0) { | 114 | if (skb->len >= 0) { |
115 | memcpy(x25->calluserdata.cuddata, skb->data, | 115 | skb_copy_from_linear_data(skb, |
116 | skb->len); | 116 | x25->calluserdata.cuddata, |
117 | skb->len); | ||
117 | x25->calluserdata.cudlength = skb->len; | 118 | x25->calluserdata.cudlength = skb->len; |
118 | } | 119 | } |
119 | if (!sock_flag(sk, SOCK_DEAD)) | 120 | if (!sock_flag(sk, SOCK_DEAD)) |
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index 6f5737853912..bb45e21ffce9 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c | |||
@@ -61,7 +61,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb) | |||
61 | 61 | ||
62 | if (skb->len - header_len > max_len) { | 62 | if (skb->len - header_len > max_len) { |
63 | /* Save a copy of the Header */ | 63 | /* Save a copy of the Header */ |
64 | memcpy(header, skb->data, header_len); | 64 | skb_copy_from_linear_data(skb, header, header_len); |
65 | skb_pull(skb, header_len); | 65 | skb_pull(skb, header_len); |
66 | 66 | ||
67 | frontlen = skb_headroom(skb); | 67 | frontlen = skb_headroom(skb); |
@@ -84,7 +84,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb) | |||
84 | len = max_len > skb->len ? skb->len : max_len; | 84 | len = max_len > skb->len ? skb->len : max_len; |
85 | 85 | ||
86 | /* Copy the user data */ | 86 | /* Copy the user data */ |
87 | memcpy(skb_put(skbn, len), skb->data, len); | 87 | skb_copy_from_linear_data(skb, skb_put(skbn, len), len); |
88 | skb_pull(skb, len); | 88 | skb_pull(skb, len); |
89 | 89 | ||
90 | /* Duplicate the Header */ | 90 | /* Duplicate the Header */ |