diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-08-11 20:40:42 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-08-12 15:30:08 +0200 |
commit | a01e836087881dd9d824417190994c9b2b0f1dbb (patch) | |
tree | dba049b83137d4cda2fdc53ed06d83897a74dc4f /drivers/firewire/ohci.c | |
parent | 9c1176b6a28850703ea6e3a0f0c703f6d6c61cd3 (diff) | |
download | op-kernel-dev-a01e836087881dd9d824417190994c9b2b0f1dbb.zip op-kernel-dev-a01e836087881dd9d824417190994c9b2b0f1dbb.tar.gz |
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>
Diffstat (limited to 'drivers/firewire/ohci.c')
-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 4f6d72f..ded0c9b 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2178,8 +2178,13 @@ static int ohci_enable(struct fw_card *card, 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; } |