From: Jirka Pirko Date: Mon, 24 Nov 2008 22:49:11 +0000 (-0800) Subject: tokenring/3c359.c: Prevent possible mem leak when open failed X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5c94afd79cd9e68cb9899fe7788342329e9f445f;p=openwrt%2Fstaging%2Fblogic.git tokenring/3c359.c: Prevent possible mem leak when open failed Freeing previously allocated buffers in case of error. Signed-off-by: Jirka Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 8a43ecd0d6e7..e7a944657cf8 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c @@ -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 ; }