فهرست منبع

[PARISC] be more defensive in process.c::get_wchan

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>
Kyle McMartin 18 سال پیش
والد
کامیت
cc650a7a9f
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      arch/parisc/kernel/process.c

+ 4 - 0
arch/parisc/kernel/process.c

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