Commit d7623710 authored by Dave Jones's avatar Dave Jones Committed by Jeff Garzik

[PATCH] 3c527 possible oops.

If the alloc_skb() fails, we dereference it in the skb_reserve() call.
Move the skb_reserve() call to after the NULL check.
Also clean up some CodingStyle violations whilst in the vicinity.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent da236a16
......@@ -751,18 +751,15 @@ static int mc32_load_rx_ring(struct net_device *dev)
rx_base=lp->rx_chain;
for(i=0; i<RX_RING_LEN; i++)
{
for(i=0; i<RX_RING_LEN; i++) {
lp->rx_ring[i].skb=alloc_skb(1532, GFP_KERNEL);
skb_reserve(lp->rx_ring[i].skb, 18);
if(lp->rx_ring[i].skb==NULL)
{
for(;i>=0;i--)
if (lp->rx_ring[i].skb==NULL) {
for (;i>=0;i--)
kfree_skb(lp->rx_ring[i].skb);
return -ENOBUFS;
}
skb_reserve(lp->rx_ring[i].skb, 18);
p=isa_bus_to_virt(lp->base+rx_base);
p->control=0;
......
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