提交 a3f2279e 编写于 作者: D Dan Carpenter 提交者: David S. Miller

hp100: unmap memory on error path

There was an error path where "mem_ptr_virt" didn't get unmapped.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9292d8f2
......@@ -720,9 +720,10 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
/* Conversion to new PCI API :
* Pages are always aligned and zeroed, no need to it ourself.
* Doc says should be OK for EISA bus as well - Jean II */
if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL) {
lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr);
if (!lp->page_vaddr_algn) {
err = -ENOMEM;
goto out2;
goto out_mem_ptr;
}
lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn);
......@@ -798,6 +799,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f,
lp->page_vaddr_algn,
virt_to_whatever(dev, lp->page_vaddr_algn));
out_mem_ptr:
if (mem_ptr_virt)
iounmap(mem_ptr_virt);
out2:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册