summaryrefslogtreecommitdiff
path: root/drivers/net/epic100.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2010-12-25 07:39:59 +0000
committerDavid S. Miller <davem@davemloft.net>2010-12-25 19:37:49 -0800
commit7a36df8a857edee8cd8967cbe99a85574d22f482 (patch)
treef0db8b481d9f721be896af6b8c3bdb0448778b4a /drivers/net/epic100.c
parent78a36f25478432835f2f1e46202b71ff3ae454ff (diff)
epic100: hamachi: yellowfin: Fix skb allocation size
Joel Soete reported oopses during pppoe over sundance NIC, caused by a bug in skb allocation and dma mapping code, where skb_reserve() bytes weren't taken into account. As a followup to the patch: "sundance: Fix oopses with corrupted skb_shared_info" very similar code is fixed here for three other drivers. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Cc: Joel Soete <soete.joel@scarlet.be> Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/epic100.c')
-rw-r--r--drivers/net/epic100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index aa56963ad558..c353bf3113cc 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -935,7 +935,7 @@ static void epic_init_ring(struct net_device *dev)
/* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) {
- struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz);
+ struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz + 2);
ep->rx_skbuff[i] = skb;
if (skb == NULL)
break;
@@ -1233,7 +1233,7 @@ static int epic_rx(struct net_device *dev, int budget)
entry = ep->dirty_rx % RX_RING_SIZE;
if (ep->rx_skbuff[entry] == NULL) {
struct sk_buff *skb;
- skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz);
+ skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz + 2);
if (skb == NULL)
break;
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */