Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df
Commit:     f7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df
Parent:     adcd33d41bfea8fb6870cf1f7e7ed2e5f7323fc1
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Aug 20 22:42:56 2007 +0200

    cs5530: 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.
    
    Also this host driver requires valid PCI BAR4 for normal operation so
    check it in ->init_chipset and fail initialization if not set.
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5530.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index acaf71f..e5949b1 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cs5530.c              Version 0.73    Mar 10 2007
+ * linux/drivers/ide/pci/cs5530.c              Version 0.74    Jul 28 2007
  *
  * Copyright (C) 2000                  Andre Hedrick <[EMAIL PROTECTED]>
  * Copyright (C) 2000                  Mark Lord <[EMAIL PROTECTED]>
@@ -207,6 +207,9 @@ static unsigned int __devinit init_chipset_cs5530 (struct 
pci_dev *dev, const ch
        struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
        unsigned long flags;
 
+       if (pci_resource_start(dev, 4) == 0)
+               return -EFAULT;
+
        dev = NULL;
        while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != 
NULL) {
                switch (dev->device) {
@@ -325,6 +328,9 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
                        /* needs autotuning later */
        }
 
+       if (hwif->dma_base == 0)
+               return;
+
        hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x07;
        hwif->mwdma_mask = 0x07;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to