Commit 5c94afd7 authored by Jirka Pirko's avatar Jirka Pirko Committed by David S. Miller

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

Freeing previously allocated buffers in case of error.
Signed-off-by: default avatarJirka Pirko <jirka@pirko.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 138a5cdf
......@@ -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 ;
}
......
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