[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1278170444-8170-1-git-send-email-segooon@gmail.com>
Date: Sat, 3 Jul 2010 19:20:42 +0400
From: Kulikov Vasiliy <segooon@...il.com>
To: Kernel Janitors <kernel-janitors@...r.kernel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Joe Perches <joe@...ches.com>,
Atsushi Nemoto <anemo@....ocn.ne.jp>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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@...il.com>
---
drivers/net/ne.c | 4 +++-
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
@@ -796,28 +796,30 @@ static int __init ne_drv_probe(struct platform_device *pdev)
dev = alloc_eip_netdev();
if (!dev)
return -ENOMEM;
/* ne.c doesn't populate resources in platform_device, but
* rbtx4927_ne_init and rbtx4938_ne_init do register devices
* with resources.
*/
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (res) {
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];
}
err = do_ne_probe(dev);
if (err) {
free_netdev(dev);
return err;
}
platform_set_drvdata(pdev, dev);
/* Update with any values found by probing, don't update if
* resources were specified.
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists