Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
[pandora-kernel.git] / arch / ia64 / kernel / process.c
index d1c3ed9..fa40cba 100644 (file)
@@ -513,7 +513,8 @@ copy_thread (int nr, unsigned long clone_flags,
 static void
 do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg)
 {
-       unsigned long mask, sp, nat_bits = 0, ip, ar_rnat, urbs_end, cfm;
+       unsigned long mask, sp, nat_bits = 0, ar_rnat, urbs_end, cfm;
+       unsigned long uninitialized_var(ip);    /* GCC be quiet */
        elf_greg_t *dst = arg;
        struct pt_regs *pt;
        char nat;
@@ -763,6 +764,9 @@ get_wchan (struct task_struct *p)
        unsigned long ip;
        int count = 0;
 
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
        /*
         * Note: p may not be a blocked task (it could be current or
         * another process running on some other CPU.  Rather than
@@ -773,6 +777,8 @@ get_wchan (struct task_struct *p)
         */
        unw_init_from_blocked_task(&info, p);
        do {
+               if (p->state == TASK_RUNNING)
+                       return 0;
                if (unw_unwind(&info) < 0)
                        return 0;
                unw_get_ip(&info, &ip);