Commit 3d54015b authored by roel kluin's avatar roel kluin Committed by David S. Miller

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2a8aaacd
...@@ -832,7 +832,9 @@ static int corkscrew_open(struct net_device *dev) ...@@ -832,7 +832,9 @@ static int corkscrew_open(struct net_device *dev)
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); vp->rx_ring[i].addr = isa_virt_to_bus(skb->data);
} }
vp->rx_ring[i - 1].next = isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ if (i != 0)
vp->rx_ring[i - 1].next =
isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */
outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr);
} }
if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment