From 5c94afd79cd9e68cb9899fe7788342329e9f445f Mon Sep 17 00:00:00 2001 From: Jirka Pirko Date: Mon, 24 Nov 2008 14:49:11 -0800 Subject: [PATCH] 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 --- drivers/net/tokenring/3c359.c | 2 ++ 1 file changed, 2 insertions(+) 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 ; } -- 2.34.1