Skip to contentSkip to conversation

triflex: add missing ->dma_base check

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 2 messages Jul 29, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 8/12 triflex: add missing ->dma_base check

If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks shouldn't be initialized or bad things will happen.

---
 drivers/ide/pci/triflex.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/ide/pci/triflex.c +3 -0
Index: b/drivers/ide/pci/triflex.c
===================================================================
@@ -111,6 +111,9 @@ static void __devinit init_hwif_triflex(
 	hwif->set_pio_mode = &triflex_set_pio_mode;
 	hwif->set_dma_mode = &triflex_set_mode;
 
+	if (hwif->dma_base == 0)
+		return;
+
 	hwif->atapi_dma  = 1;
 	hwif->mwdma_mask = 0x07;
 	hwif->swdma_mask = 0x07;