Commit b31fb868 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by David S. Miller

tc35815: fix iomap leak

If tc35815_init_one() fails we must unmap mapped regions.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60eb5fd1
...@@ -854,7 +854,7 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev, ...@@ -854,7 +854,7 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
rc = register_netdev(dev); rc = register_netdev(dev);
if (rc) if (rc)
goto err_out; goto err_out_iounmap;
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
printk(KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n", 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, ...@@ -872,6 +872,8 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
err_out_unregister: err_out_unregister:
unregister_netdev(dev); unregister_netdev(dev);
err_out_iounmap:
pcim_iounmap_regions(pdev, 1 << 1);
err_out: err_out:
free_netdev(dev); free_netdev(dev);
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment