Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ccd05d086f82dba2ab117dcaf4a38cbb2863a439
Commit:     ccd05d086f82dba2ab117dcaf4a38cbb2863a439
Parent:     85687ff2b4eab47f4d637a0d3a482bb955d3cbd4
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 16:37:02 2008 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 19:52:39 2008 +1100

    [POWERPC] Fix cell IOMMU null pointer explosion on old firmwares
    
    The cell IOMMU fixed mapping support has a null pointer bug if you run
    it on older firmwares that don't contain the "dma-ranges" properties.
    Fix it and convert to using of_get_next_parent() while we're there.
    
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/iommu.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/cell/iommu.c 
b/arch/powerpc/platforms/cell/iommu.c
index df33066..a276064 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -26,6 +26,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/notifier.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
 
 #include <asm/prom.h>
@@ -789,18 +790,16 @@ static int __init cell_iommu_init_disabled(void)
 static u64 cell_iommu_get_fixed_address(struct device *dev)
 {
        u64 cpu_addr, size, best_size, pci_addr = OF_BAD_ADDR;
-       struct device_node *tmp, *np;
+       struct device_node *np;
        const u32 *ranges = NULL;
        int i, len, best;
 
-       np = dev->archdata.of_node;
-       of_node_get(np);
-       ranges = of_get_property(np, "dma-ranges", &len);
-       while (!ranges && np) {
-               tmp = of_get_parent(np);
-               of_node_put(np);
-               np = tmp;
+       np = of_node_get(dev->archdata.of_node);
+       while (np) {
                ranges = of_get_property(np, "dma-ranges", &len);
+               if (ranges)
+                       break;
+               np = of_get_next_parent(np);
        }
 
        if (!ranges) {
-
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