tokenring/3c359.c: Prevent possible mem leak when open failed
authorJirka Pirko <jirka@pirko.cz>
Mon, 24 Nov 2008 22:49:11 +0000 (14:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Nov 2008 22:49:11 +0000 (14:49 -0800)
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>
drivers/net/tokenring/3c359.c

index 8a43ecd0d6e7596c08d2723c33348dac850aad01..e7a944657cf8bc966c76d9a0dcb46bac0a9ea3d8 100644 (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 ; 
        }