Skip to content

Commit

Permalink
triflex: add missing ->dma_base check
Browse files Browse the repository at this point in the history
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Aug 20, 2007
1 parent e98d6e5 commit 88b4704
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/ide/pci/triflex.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
hwif->tuneproc = &triflex_tune_drive;
hwif->speedproc = &triflex_tune_chipset;

if (hwif->dma_base == 0)
return;

hwif->atapi_dma = 1;
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;
Expand Down

0 comments on commit 88b4704

Please sign in to comment.