diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2010-12-25 02:39:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-25 22:37:49 -0500 |
commit | 7a36df8a857edee8cd8967cbe99a85574d22f482 (patch) | |
tree | f0db8b481d9f721be896af6b8c3bdb0448778b4a /drivers/net/yellowfin.c | |
parent | 78a36f25478432835f2f1e46202b71ff3ae454ff (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/yellowfin.c')
-rw-r--r-- | drivers/net/yellowfin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index cd1b3dcd61db..ec47e22fa186 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -744,7 +744,7 @@ static int yellowfin_init_ring(struct net_device *dev) | |||
744 | } | 744 | } |
745 | 745 | ||
746 | for (i = 0; i < RX_RING_SIZE; i++) { | 746 | for (i = 0; i < RX_RING_SIZE; i++) { |
747 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); | 747 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); |
748 | yp->rx_skbuff[i] = skb; | 748 | yp->rx_skbuff[i] = skb; |
749 | if (skb == NULL) | 749 | if (skb == NULL) |
750 | break; | 750 | break; |
@@ -1157,7 +1157,7 @@ static int yellowfin_rx(struct net_device *dev) | |||
1157 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { | 1157 | for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { |
1158 | entry = yp->dirty_rx % RX_RING_SIZE; | 1158 | entry = yp->dirty_rx % RX_RING_SIZE; |
1159 | if (yp->rx_skbuff[entry] == NULL) { | 1159 | if (yp->rx_skbuff[entry] == NULL) { |
1160 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); | 1160 | struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2); |
1161 | if (skb == NULL) | 1161 | if (skb == NULL) |
1162 | break; /* Better luck next round. */ | 1162 | break; /* Better luck next round. */ |
1163 | yp->rx_skbuff[entry] = skb; | 1163 | yp->rx_skbuff[entry] = skb; |