diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-12-21 01:20:53 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-22 22:53:05 -0500 |
commit | 8a5ed9efe661dd42bc140e522c2635e0d7b26141 (patch) | |
tree | 9f37f414587fa25e4ab34290a67789f67d4dcc02 /drivers/net/typhoon.c | |
parent | b46281f9c5d6ab7b6e412e83f8c62cecf4ebbdfd (diff) |
typhoon: missed rx overruns on big-endian
rxBuffCleared is little-endian; we miss le32_to_cpu() in checks for
rx ring overruns.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/typhoon.c')
-rw-r--r-- | drivers/net/typhoon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 16d443b71264..501abe379047 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -1596,7 +1596,7 @@ typhoon_recycle_rx_skb(struct typhoon *tp, u32 idx) | |||
1596 | struct rx_free *r; | 1596 | struct rx_free *r; |
1597 | 1597 | ||
1598 | if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) == | 1598 | if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) == |
1599 | indexes->rxBuffCleared) { | 1599 | le32_to_cpu(indexes->rxBuffCleared)) { |
1600 | /* no room in ring, just drop the skb | 1600 | /* no room in ring, just drop the skb |
1601 | */ | 1601 | */ |
1602 | dev_kfree_skb_any(rxb->skb); | 1602 | dev_kfree_skb_any(rxb->skb); |
@@ -1627,7 +1627,7 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx) | |||
1627 | rxb->skb = NULL; | 1627 | rxb->skb = NULL; |
1628 | 1628 | ||
1629 | if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) == | 1629 | if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) == |
1630 | indexes->rxBuffCleared) | 1630 | le32_to_cpu(indexes->rxBuffCleared)) |
1631 | return -ENOMEM; | 1631 | return -ENOMEM; |
1632 | 1632 | ||
1633 | skb = dev_alloc_skb(PKT_BUF_SZ); | 1633 | skb = dev_alloc_skb(PKT_BUF_SZ); |