summaryrefslogtreecommitdiffstats
path: root/drivers/net/ne.c
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-03 05:20:42 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-05 20:08:05 -0700
commit3390712a474abdcd3de10024dd1062e5928d381c (patch)
tree1089f92b86d040dbd50a8bb589910e465e152623 /drivers/net/ne.c
parent44b451f1633896de15d2d52e1a2bd462e80b7814 (diff)
downloadop-kernel-dev-3390712a474abdcd3de10024dd1062e5928d381c.zip
op-kernel-dev-3390712a474abdcd3de10024dd1062e5928d381c.tar.gz
net/ne: fix memory leak in ne_drv_probe()
net_device allocated with alloc_eip_netdev() must be freed. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ne.c')
-rw-r--r--drivers/net/ne.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index b8e2923..1063093 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -806,8 +806,10 @@ static int __init ne_drv_probe(struct platform_device *pdev)
dev->base_addr = res->start;
dev->irq = platform_get_irq(pdev, 0);
} else {
- if (this_dev < 0 || this_dev >= MAX_NE_CARDS)
+ if (this_dev < 0 || this_dev >= MAX_NE_CARDS) {
+ free_netdev(dev);
return -EINVAL;
+ }
dev->base_addr = io[this_dev];
dev->irq = irq[this_dev];
dev->mem_end = bad[this_dev];
OpenPOWER on IntegriCloud