sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
                return true;
 
-       base = (unsigned long) hardirq_stack[tp->cpu];
-       if (sp >= base &&
-           sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
-               return true;
-       base = (unsigned long) softirq_stack[tp->cpu];
-       if (sp >= base &&
-           sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
-               return true;
-
+       if (hardirq_stack[tp->cpu]) {
+               base = (unsigned long) hardirq_stack[tp->cpu];
+               if (sp >= base &&
+                   sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
+                       return true;
+               base = (unsigned long) softirq_stack[tp->cpu];
+               if (sp >= base &&
+                   sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
+                       return true;
+       }
        return false;
 }
 
            addr <= (base + THREAD_SIZE - sizeof(*regs)))
                goto check_magic;
 
-       base = (unsigned long) hardirq_stack[tp->cpu];
-       if (addr >= base &&
-           addr <= (base + THREAD_SIZE - sizeof(*regs)))
-               goto check_magic;
-       base = (unsigned long) softirq_stack[tp->cpu];
-       if (addr >= base &&
-           addr <= (base + THREAD_SIZE - sizeof(*regs)))
-               goto check_magic;
-
+       if (hardirq_stack[tp->cpu]) {
+               base = (unsigned long) hardirq_stack[tp->cpu];
+               if (addr >= base &&
+                   addr <= (base + THREAD_SIZE - sizeof(*regs)))
+                       goto check_magic;
+               base = (unsigned long) softirq_stack[tp->cpu];
+               if (addr >= base &&
+                   addr <= (base + THREAD_SIZE - sizeof(*regs)))
+                       goto check_magic;
+       }
        return false;
 
 check_magic:
 
 
 void save_stack_trace(struct stack_trace *trace)
 {
-       unsigned long ksp, fp, thread_base;
        struct thread_info *tp = task_thread_info(current);
+       unsigned long ksp, fp;
 
        stack_trace_flush();
 
        );
 
        fp = ksp + STACK_BIAS;
-       thread_base = (unsigned long) tp;
        do {
                struct sparc_stackf *sf;
                struct pt_regs *regs;