Skip to contentSkip to conversation

firewire: ohci: fix DMA unmapping in an error path

PATCH New Stefan Richter 1 participant 1 message Aug 11, 2011 2 messages not in the archive Firewire

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20110810164515.78a8f06d@stein

A message that is not in the archive (sent off-list or not yet received): 20110811085159.42522d39@stein

#2 lore raw

PATCH 1/1 firewire: ohci: fix DMA unmapping in an error path

If request_irq failed, we would pass wrong arguments to dma_free_coherent. https://bugzilla.redhat.com/show_bug.cgi?id=728185

Reported-by Mads Kiilerich
---
 drivers/firewire/ohci.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/firewire/ohci.c +7 -2
Index: b/drivers/firewire/ohci.c
===================================================================
@@ -2181,8 +2181,13 @@ static int ohci_enable(struct fw_card *c
 			ohci_driver_name, ohci)) {
 		fw_error("Failed to allocate interrupt %d.\n", dev->irq);
 		pci_disable_msi(dev);
-		dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
-				  ohci->config_rom, ohci->config_rom_bus);
+
+		if (config_rom) {
+			dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
+					  ohci->next_config_rom,
+					  ohci->next_config_rom_bus);
+			ohci->next_config_rom = NULL;
+		}
 		return -EIO;
 	}
 
Signature · 3 lines
Stefan Richter
-=====-==-== =--- -=-==
http://arcgraph.de/sr/