[PARISC] be more defensive in process.c::get_wchan
authorKyle McMartin <kyle@parisc-linux.org>
Wed, 30 May 2007 06:36:00 +0000 (02:36 -0400)
committerKyle McMartin <kyle@minerva.i.cabal.ca>
Wed, 30 May 2007 06:36:00 +0000 (02:36 -0400)
While debugging, I noticed we don't check the task_struct arg passed to
get_wchan, whereas everyone else does.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
arch/parisc/kernel/process.c

index 0dd3847..3556648 100644 (file)
@@ -381,6 +381,10 @@ get_wchan(struct task_struct *p)
        struct unwind_frame_info info;
        unsigned long ip;
        int count = 0;
+
+       if (!p || p == current || p->state == TASK_RUNNING)
+               return 0;
+
        /*
         * These bracket the sleeping functions..
         */