aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-02 19:08:43 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-02 19:08:43 -0400
commita3f2279ea06d8521c2d7abb0f6c0f48c7f5a6508 (patch)
tree249faafd990f8e8cdd328577fb7c82440f9f54f7 /drivers
parent9292d8f20ff3c034c99c2adfe27496957b3defe3 (diff)
hp100: unmap memory on error path
There was an error path where "mem_ptr_virt" didn't get unmapped. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/hp100.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index acbf0d003a6d..ce587f4c4203 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -720,9 +720,10 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
720 /* Conversion to new PCI API : 720 /* Conversion to new PCI API :
721 * Pages are always aligned and zeroed, no need to it ourself. 721 * Pages are always aligned and zeroed, no need to it ourself.
722 * Doc says should be OK for EISA bus as well - Jean II */ 722 * Doc says should be OK for EISA bus as well - Jean II */
723 if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL) { 723 lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr);
724 if (!lp->page_vaddr_algn) {
724 err = -ENOMEM; 725 err = -ENOMEM;
725 goto out2; 726 goto out_mem_ptr;
726 } 727 }
727 lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn); 728 lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn);
728 729
@@ -798,6 +799,7 @@ out3:
798 pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f, 799 pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f,
799 lp->page_vaddr_algn, 800 lp->page_vaddr_algn,
800 virt_to_whatever(dev, lp->page_vaddr_algn)); 801 virt_to_whatever(dev, lp->page_vaddr_algn));
802out_mem_ptr:
801 if (mem_ptr_virt) 803 if (mem_ptr_virt)
802 iounmap(mem_ptr_virt); 804 iounmap(mem_ptr_virt);
803out2: 805out2: