aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c515.c
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2009-07-29 20:26:32 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-30 16:27:28 -0400
commit3d54015b750e5d5e950a1dcee2735387fd4b6e1a (patch)
tree3973a0cf147b4069bf3b33609e191cd9c70a1d1d /drivers/net/3c515.c
parent2a8aaacda5097fa92a39948da1b4c6614b6e150e (diff)
3c515: Write outside array bounds
if dev_alloc_skb() fails on the first iteration, a write to cp->rx_ring[-1] occurs. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/3c515.c')
-rw-r--r--drivers/net/3c515.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 3e00fa8ea65f..4a7c32895be5 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -832,7 +832,9 @@ static int corkscrew_open(struct net_device *dev)
832 skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ 832 skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
833 vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); 833 vp->rx_ring[i].addr = isa_virt_to_bus(skb->data);
834 } 834 }
835 vp->rx_ring[i - 1].next = isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ 835 if (i != 0)
836 vp->rx_ring[i - 1].next =
837 isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */
836 outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); 838 outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr);
837 } 839 }
838 if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ 840 if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */