diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-08-11 14:40:42 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-08-12 09:30:08 -0400 |
commit | a01e836087881dd9d824417190994c9b2b0f1dbb (patch) | |
tree | dba049b83137d4cda2fdc53ed06d83897a74dc4f | |
parent | 9c1176b6a28850703ea6e3a0f0c703f6d6c61cd3 (diff) |
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
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/ohci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 4f6d72f87f6f..ded0c9bf96f4 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -2178,8 +2178,13 @@ static int ohci_enable(struct fw_card *card, | |||
2178 | ohci_driver_name, ohci)) { | 2178 | ohci_driver_name, ohci)) { |
2179 | fw_error("Failed to allocate interrupt %d.\n", dev->irq); | 2179 | fw_error("Failed to allocate interrupt %d.\n", dev->irq); |
2180 | pci_disable_msi(dev); | 2180 | pci_disable_msi(dev); |
2181 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | 2181 | |
2182 | ohci->config_rom, ohci->config_rom_bus); | 2182 | if (config_rom) { |
2183 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | ||
2184 | ohci->next_config_rom, | ||
2185 | ohci->next_config_rom_bus); | ||
2186 | ohci->next_config_rom = NULL; | ||
2187 | } | ||
2183 | return -EIO; | 2188 | return -EIO; |
2184 | } | 2189 | } |
2185 | 2190 | ||