]> git.sur5r.net Git - openocd/commitdiff
ARM926: fix arm926ejs_mmu() reading from bad pointer
authorDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 31 Oct 2009 00:29:38 +0000 (17:29 -0700)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 31 Oct 2009 00:29:38 +0000 (17:29 -0700)
I'm suspecting this code can never have worked, since the
original commit (svn #335) in early 2008.

Fix is just copy/paste from another (working) function.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/arm926ejs.c

index 53f7980998e8a80bac483006a0a25b0db1cf0c9f..608a7edfb16da2f068662cb57999a327ff86df87 100644 (file)
@@ -906,7 +906,9 @@ static int arm926ejs_virt2phys(struct target_s *target, uint32_t virtual, uint32
 static int arm926ejs_mmu(struct target_s *target, int *enabled)
 {
        armv4_5_common_t *armv4_5 = target->arch_info;
-       arm926ejs_common_t *arm926ejs = armv4_5->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       arm9tdmi_common_t *arm9tdmi = arm7_9->arch_info;
+       arm926ejs_common_t *arm926ejs = arm9tdmi->arch_info;
 
        if (target->state != TARGET_HALTED)
        {