tokenring/3c359.c: Prevent possible mem leak when open failed

Freeing previously allocated buffers in case of error.

Signed-off-by: Jirka Pirko <jirka@pirko.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jirka Pirko 2008-11-24 14:49:11 -08:00 committed by David S. Miller
parent 138a5cdf2f
commit 5c94afd79c

View File

@ -669,6 +669,8 @@ static int xl_open(struct net_device *dev)
if (i==0) {
printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled \n",dev->name) ;
free_irq(dev->irq,dev) ;
kfree(xl_priv->xl_tx_ring);
kfree(xl_priv->xl_rx_ring);
return -EIO ;
}