diff options
Diffstat (limited to 'drivers/usb/atm/usbatm.c')
-rw-r--r-- | drivers/usb/atm/usbatm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index ec63b0ee0743..d3e2c5f90a26 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -343,7 +343,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char | |||
343 | UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); | 343 | UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); |
344 | } | 344 | } |
345 | 345 | ||
346 | memcpy(sarb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); | 346 | memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); |
347 | __skb_put(sarb, ATM_CELL_PAYLOAD); | 347 | __skb_put(sarb, ATM_CELL_PAYLOAD); |
348 | 348 | ||
349 | if (pti & 1) { | 349 | if (pti & 1) { |
@@ -370,7 +370,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char | |||
370 | goto out; | 370 | goto out; |
371 | } | 371 | } |
372 | 372 | ||
373 | if (crc32_be(~0, sarb->tail - pdu_length, pdu_length) != 0xc704dd7b) { | 373 | if (crc32_be(~0, skb_tail_pointer(sarb) - pdu_length, pdu_length) != 0xc704dd7b) { |
374 | atm_rldbg(instance, "%s: packet failed crc check (vcc: 0x%p)!\n", | 374 | atm_rldbg(instance, "%s: packet failed crc check (vcc: 0x%p)!\n", |
375 | __func__, vcc); | 375 | __func__, vcc); |
376 | atomic_inc(&vcc->stats->rx_err); | 376 | atomic_inc(&vcc->stats->rx_err); |
@@ -396,7 +396,9 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char | |||
396 | goto out; /* atm_charge increments rx_drop */ | 396 | goto out; /* atm_charge increments rx_drop */ |
397 | } | 397 | } |
398 | 398 | ||
399 | memcpy(skb->data, sarb->tail - pdu_length, length); | 399 | skb_copy_to_linear_data(skb, |
400 | skb_tail_pointer(sarb) - pdu_length, | ||
401 | length); | ||
400 | __skb_put(skb, length); | 402 | __skb_put(skb, length); |
401 | 403 | ||
402 | vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u", | 404 | vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u", |
@@ -484,7 +486,7 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, | |||
484 | ptr[4] = 0xec; | 486 | ptr[4] = 0xec; |
485 | ptr += ATM_CELL_HEADER; | 487 | ptr += ATM_CELL_HEADER; |
486 | 488 | ||
487 | memcpy(ptr, skb->data, data_len); | 489 | skb_copy_from_linear_data(skb, ptr, data_len); |
488 | ptr += data_len; | 490 | ptr += data_len; |
489 | __skb_pull(skb, data_len); | 491 | __skb_pull(skb, data_len); |
490 | 492 | ||