tc35815: fix iomap leak
authorKulikov Vasiliy <segooon@gmail.com>
Sat, 10 Jul 2010 00:03:18 +0000 (00:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Jul 2010 03:21:42 +0000 (20:21 -0700)
If tc35815_init_one() fails we must unmap mapped regions.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tc35815.c

index be08b75..99afa5c 100644 (file)
@@ -854,7 +854,7 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
 
        rc = register_netdev(dev);
        if (rc)
-               goto err_out;
+               goto err_out_iounmap;
 
        memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
        printk(KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n",
@@ -872,6 +872,8 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
 
 err_out_unregister:
        unregister_netdev(dev);
+err_out_iounmap:
+       pcim_iounmap_regions(pdev, 1 << 1);
 err_out:
        free_netdev(dev);
        return rc;