From: Kulikov Vasiliy Date: Sat, 3 Jul 2010 05:20:42 +0000 (+0000) Subject: net/ne: fix memory leak in ne_drv_probe() X-Git-Tag: upstream/snapshot3+hdmi~13834^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3390712a474abdcd3de10024dd1062e5928d381c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git net/ne: fix memory leak in ne_drv_probe() net_device allocated with alloc_eip_netdev() must be freed. Signed-off-by: Kulikov Vasiliy Signed-off-by: David S. Miller --- 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];