[PATCH] sound/oss/btaudio.c: ioremap balanced with iounmap

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>
This commit is contained in:
Amol Lad 2006-12-06 20:35:23 -08:00 committed by Linus Torvalds
parent aa8a8d6648
commit b9d85b08c6

View File

@ -1020,6 +1020,7 @@ static int __devinit btaudio_probe(struct pci_dev *pci_dev,
fail2: fail2:
free_irq(bta->irq,bta); free_irq(bta->irq,bta);
fail1: fail1:
iounmap(bta->mmio);
kfree(bta); kfree(bta);
fail0: fail0:
release_mem_region(pci_resource_start(pci_dev,0), release_mem_region(pci_resource_start(pci_dev,0),
@ -1051,6 +1052,7 @@ static void __devexit btaudio_remove(struct pci_dev *pci_dev)
free_irq(bta->irq,bta); free_irq(bta->irq,bta);
release_mem_region(pci_resource_start(pci_dev,0), release_mem_region(pci_resource_start(pci_dev,0),
pci_resource_len(pci_dev,0)); pci_resource_len(pci_dev,0));
iounmap(bta->mmio);
/* remove from linked list */ /* remove from linked list */
if (bta == btaudios) { if (bta == btaudios) {