Skip to contentSkip to conversation

kirkwood: Fix uninitialised DRAM struct

PATCH New Gray Remlin 1 participant 1 message Oct 19, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kirkwood: Fix uninitialised DRAM struct

Breaking out of the loop leaves the rest of the struct uninitialised

---
 arch/arm/cpu/arm926ejs/kirkwood/dram.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
index 7439c87..50bed63 100644

arch/arm/cpu/arm926ejs/kirkwood/dram.c +2 -5
@@ -75,11 +75,8 @@ int dram_init(void)
                 * If the gap is found, ram_size will be reported for
                 * consecutive memory only
                 */
-               if (gd->bd->bi_dram[i].start != gd->ram_size)
-                       break;
-
-               gd->ram_size += gd->bd->bi_dram[i].size;
-
+               if (gd->bd->bi_dram[i].start == gd->ram_size)
+                       gd->ram_size += gd->bd->bi_dram[i].size;
        }
        return 0;
 }

--