net/ne: fix memory leak in ne_drv_probe()
authorKulikov Vasiliy <segooon@gmail.com>
Sat, 3 Jul 2010 05:20:42 +0000 (05:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Jul 2010 03:08:05 +0000 (20:08 -0700)
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>
drivers/net/ne.c

index b8e2923a1d69e4d50fe7c9e47620c69b42a1005f..1063093b3afc5cfd9cd1545b73cbbdd64db0ec12 100644 (file)
@@ -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];