Skip to content

Commit

Permalink
[PARISC] be more defensive in process.c::get_wchan
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kyle McMartin authored and Kyle McMartin committed May 30, 2007
1 parent 376e210 commit cc650a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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..
*/
Expand Down

0 comments on commit cc650a7

Please sign in to comment.