Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=650f7b3b2f0ead0673e90452cf3dedde97c537ba
Commit:     650f7b3b2f0ead0673e90452cf3dedde97c537ba
Parent:     8fce6dd29fa9d1ac880bf0cb4528e9bd5878cf68
Author:     Linas Vepstas <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 11 06:11:23 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed May 2 20:04:29 2007 +1000

    [POWERPC] pseries: Handle null iommu dma-window property correctly
    
    Some versions of pSeries firmware fail to set up a
    dma-window property for PCI slots that are unoccupied.
    As a result, the loop searching for this propery, in
    pci_dma_dev_setup_pSeriesLP(), can run to the end, resulting
    in a NULL pointer dereference later in the routine. This
    patch prevents the crash, and prints a warning message.
    
    This is theoretically a rare error, as it occurs on what
    is hopefully just beta levels of firmware. But just in case
    this firmware escapes into the wild, this patch will avoid
    the crash.
    
    Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/iommu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c 
b/arch/powerpc/platforms/pseries/iommu.c
index 66665c8..eec684a 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -504,6 +504,12 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev 
*dev)
                        break;
        }
 
+       if (!pdn || !PCI_DN(pdn)) {
+               printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
+                      "no DMA window found for pci dev=%s dn=%s\n",
+                                pci_name(dev), dn? dn->full_name : "<null>");
+               return;
+       }
        DBG("  parent is %s\n", pdn->full_name);
 
        /* Check for parent == NULL so we don't try to setup the empty EADS
-
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