Commit 16fb359f authored by Kirill Korotaev's avatar Kirill Korotaev Committed by Linus Torvalds

[PATCH] Fix do_each_task_pid() loop with 'continue' inside

Dmitry Torokhov triggered a problem in the new pidhash macros: These
do_each_task_pid()/while_each_task_pid() do loop forever if you use a
'continue' inside them. 

The end of the loop has to be inside the "while()" statement, so as to
not make "continue" jump over it.
parent 25c2ccd7
......@@ -46,10 +46,10 @@ extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thr
do {
#define while_each_task_pid(who, type, task) \
task = pid_task((task)->pids[type].pid_list.next,\
type); \
prefetch((task)->pids[type].pid_list.next); \
} while (hlist_unhashed(&(task)->pids[type].pid_chain));\
} while (task = pid_task((task)->pids[type].pid_list.next,\
type), \
prefetch((task)->pids[type].pid_list.next), \
hlist_unhashed(&(task)->pids[type].pid_chain)); \
} \
#endif /* _LINUX_PID_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment