Messages in this thread Patch in this message | | | Date | Fri, 8 Feb 2013 11:39:56 +0800 | Subject | [PATCH 1/2] stop_machine: check work->done while handling enqueued works | From | Hillf Danton <> |
| |
The comment just above cpu_stop_signal_done() says it is uncertain that the input @done is valid, and the works enqueued through the function stop_one_cpu_nowait() do carry no done, thus we have to check if it is valid when updating work result.
Signed-off-by: Hillf Danton <dhillf@gmail.com> ---
--- a/kernel/stop_machine.c Thu Feb 7 20:03:10 2013 +++ b/kernel/stop_machine.c Fri Feb 8 11:07:40 2013 @@ -279,7 +279,7 @@ repeat: preempt_disable();
ret = fn(arg); - if (ret) + if (ret && done != NULL) done->ret = ret;
/* restore preemption and check it's still balanced */ --
| |