Skip to content

Commit

Permalink
[PATCH] sound/oss/btaudio.c: ioremap balanced with iounmap
Browse files Browse the repository at this point in the history
ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Amol Lad authored and Linus Torvalds committed Dec 7, 2006
1 parent aa8a8d6 commit b9d85b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/oss/btaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ static int __devinit btaudio_probe(struct pci_dev *pci_dev,
fail2:
free_irq(bta->irq,bta);
fail1:
iounmap(bta->mmio);
kfree(bta);
fail0:
release_mem_region(pci_resource_start(pci_dev,0),
Expand Down Expand Up @@ -1051,6 +1052,7 @@ static void __devexit btaudio_remove(struct pci_dev *pci_dev)
free_irq(bta->irq,bta);
release_mem_region(pci_resource_start(pci_dev,0),
pci_resource_len(pci_dev,0));
iounmap(bta->mmio);

/* remove from linked list */
if (bta == btaudios) {
Expand Down

0 comments on commit b9d85b0

Please sign in to comment.