* [patch] hp100: unmap memory on error path
@ 2010-07-30 9:06 Dan Carpenter
2010-08-02 23:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-07-30 9:06 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: David S. Miller, Jiri Pirko, Stephen Hemminger, netdev,
kernel-janitors
There was an error path where "mem_ptr_virt" didn't get unmapped.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index acbf0d0..ce587f4 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,
/* 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 @@ out3:
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:
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-02 23:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 9:06 [patch] hp100: unmap memory on error path Dan Carpenter
2010-08-02 23:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).