Skip to content

Commit

Permalink
8139cp: balance dma_map_single vs dma_unmap_single pair
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Francois Romieu authored and David S. Miller committed Aug 13, 2009
1 parent 9799218 commit 839d162
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
dma_addr_t mapping;
struct sk_buff *skb, *new_skb;
struct cp_desc *desc;
unsigned buflen;
const unsigned buflen = cp->rx_buf_sz;

skb = cp->rx_skb[rx_tail];
BUG_ON(!skb);
Expand Down Expand Up @@ -549,8 +549,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
pr_debug("%s: rx slot %d status 0x%x len %d\n",
dev->name, rx_tail, status, len);

buflen = cp->rx_buf_sz + NET_IP_ALIGN;
new_skb = netdev_alloc_skb(dev, buflen);
new_skb = netdev_alloc_skb(dev, buflen + NET_IP_ALIGN);
if (!new_skb) {
dev->stats.rx_dropped++;
goto rx_next;
Expand Down

0 comments on commit 839d162

Please sign in to comment.