diff options
author | Jirka Pirko <jirka@pirko.cz> | 2008-11-24 14:49:11 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-24 14:49:11 -0800 |
commit | 5c94afd79cd9e68cb9899fe7788342329e9f445f (patch) | |
tree | 2ea134e0418a2e2fb0bce5ac9cec9a02ad591b3c /drivers/net | |
parent | 138a5cdf2ffe8c6602641f8aaa00cfcf10929fe1 (diff) | |
download | linux-3.10-5c94afd79cd9e68cb9899fe7788342329e9f445f.tar.gz linux-3.10-5c94afd79cd9e68cb9899fe7788342329e9f445f.tar.bz2 linux-3.10-5c94afd79cd9e68cb9899fe7788342329e9f445f.zip |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tokenring/3c359.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 8a43ecd0d6e..e7a944657cf 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 ; } |