Skip to content

Commit

Permalink
tc35815: fix iomap leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kulikov Vasiliy authored and David S. Miller committed Jul 13, 2010
1 parent 60eb5fd commit b31fb86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/tc35815.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
Expand Down

0 comments on commit b31fb86

Please sign in to comment.