diff options
-rw-r--r-- | arch/blackfin/kernel/traps.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index de249d6fdd9c..d0f675422074 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -137,17 +137,30 @@ static void decode_address(char *buf, unsigned long address) | |||
137 | /* FLAT does not have its text aligned to the start of | 137 | /* FLAT does not have its text aligned to the start of |
138 | * the map while FDPIC ELF does ... | 138 | * the map while FDPIC ELF does ... |
139 | */ | 139 | */ |
140 | if (current->mm && | 140 | |
141 | (address > current->mm->start_code) && | 141 | /* before we can check flat/fdpic, we need to |
142 | (address < current->mm->end_code)) | 142 | * make sure current is valid |
143 | offset = address - current->mm->start_code; | 143 | */ |
144 | else | 144 | if ((unsigned long)current >= FIXED_CODE_START && |
145 | offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT); | 145 | !((unsigned long)current & 0x3)) { |
146 | 146 | if (current->mm && | |
147 | sprintf(buf, "<0x%p> [ %s + 0x%lx ]", | 147 | (address > current->mm->start_code) && |
148 | (void *)address, name, offset); | 148 | (address < current->mm->end_code)) |
149 | offset = address - current->mm->start_code; | ||
150 | else | ||
151 | offset = (address - vma->vm_start) + | ||
152 | (vma->vm_pgoff << PAGE_SHIFT); | ||
153 | |||
154 | sprintf(buf, "<0x%p> [ %s + 0x%lx ]", | ||
155 | (void *)address, name, offset); | ||
156 | } else | ||
157 | sprintf(buf, "<0x%p> [ %s vma:0x%lx-0x%lx]", | ||
158 | (void *)address, name, | ||
159 | vma->vm_start, vma->vm_end); | ||
160 | |||
149 | if (!in_atomic) | 161 | if (!in_atomic) |
150 | mmput(mm); | 162 | mmput(mm); |
163 | |||
151 | goto done; | 164 | goto done; |
152 | } | 165 | } |
153 | 166 | ||
@@ -658,7 +671,8 @@ void dump_bfin_process(struct pt_regs *fp) | |||
658 | /* Because we are crashing, and pointers could be bad, we check things | 671 | /* Because we are crashing, and pointers could be bad, we check things |
659 | * pretty closely before we use them | 672 | * pretty closely before we use them |
660 | */ | 673 | */ |
661 | if (!((unsigned long)current & 0x3) && current->pid) { | 674 | if ((unsigned long)current >= FIXED_CODE_START && |
675 | !((unsigned long)current & 0x3) && current->pid) { | ||
662 | printk(KERN_NOTICE "CURRENT PROCESS:\n"); | 676 | printk(KERN_NOTICE "CURRENT PROCESS:\n"); |
663 | if (current->comm >= (char *)FIXED_CODE_START) | 677 | if (current->comm >= (char *)FIXED_CODE_START) |
664 | printk(KERN_NOTICE "COMM=%s PID=%d\n", | 678 | printk(KERN_NOTICE "COMM=%s PID=%d\n", |