8139cp: balance dma_map_single vs dma_unmap_single pair
The driver always: 1. allocate cp->rx_buf_sz + NET_IP_ALIGN 2. map cp->rx_buf_sz Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9799218ae3
commit
839d1624b9
|
@ -515,7 +515,7 @@ rx_status_loop:
|
||||||
dma_addr_t mapping;
|
dma_addr_t mapping;
|
||||||
struct sk_buff *skb, *new_skb;
|
struct sk_buff *skb, *new_skb;
|
||||||
struct cp_desc *desc;
|
struct cp_desc *desc;
|
||||||
unsigned buflen;
|
const unsigned buflen = cp->rx_buf_sz;
|
||||||
|
|
||||||
skb = cp->rx_skb[rx_tail];
|
skb = cp->rx_skb[rx_tail];
|
||||||
BUG_ON(!skb);
|
BUG_ON(!skb);
|
||||||
|
@ -549,8 +549,7 @@ rx_status_loop:
|
||||||
pr_debug("%s: rx slot %d status 0x%x len %d\n",
|
pr_debug("%s: rx slot %d status 0x%x len %d\n",
|
||||||
dev->name, rx_tail, status, len);
|
dev->name, rx_tail, status, len);
|
||||||
|
|
||||||
buflen = cp->rx_buf_sz + NET_IP_ALIGN;
|
new_skb = netdev_alloc_skb(dev, buflen + NET_IP_ALIGN);
|
||||||
new_skb = netdev_alloc_skb(dev, buflen);
|
|
||||||
if (!new_skb) {
|
if (!new_skb) {
|
||||||
dev->stats.rx_dropped++;
|
dev->stats.rx_dropped++;
|
||||||
goto rx_next;
|
goto rx_next;
|
||||||
|
|
Loading…
Reference in New Issue