public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firewire: ohci: fix DMA unmapping in an error path
       [not found] ` <20110811085159.42522d39@stein>
@ 2011-08-11 18:40   ` Stefan Richter
  0 siblings, 0 replies; only message in thread
From: Stefan Richter @ 2011-08-11 18:40 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

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>
---
 drivers/firewire/ohci.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: b/drivers/firewire/ohci.c
===================================================================
--- a/drivers/firewire/ohci.c
+++ 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;
 	}
 


-- 
Stefan Richter
-=====-==-== =--- -=-==
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-11 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110810164515.78a8f06d@stein>
     [not found] ` <20110811085159.42522d39@stein>
2011-08-11 18:40   ` [PATCH] firewire: ohci: fix DMA unmapping in an error path Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox