kernel/events/core: check return value of task_function_call()
Subsystems (2)
PATCH 1/1 kernel/events/core: check return value of task_function_call()
Check the return value of task_function_call(), which could be error code when the execution fails.
Signed-off-by Li Zhong <[email protected]>
--- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/events/core.c +2 -1
@@ -13520,7 +13520,8 @@ static void perf_cgroup_attach(struct cgroup_taskset *tset)struct cgroup_subsys_state *css;cgroup_taskset_for_each (task, css, tset) -task_function_call (task, __perf_cgroup_move, task); +if (!task_function_call (task, __perf_cgroup_move, task)) +return ; }struct cgroup_subsys perf_event_cgrp_subsys = {
Signature · 1 line
2.25.1
Peter Zijlstra
maintainerQuoted 2 lines · Li Zhong
Check the return value of
task_function_call(), which could be error code when the execution fails.
How is terminating the cgroup task iteration a useful thing? Also coding style fail for not adding { }
Quoted 22 lines
Signed-off-by Li Zhong <[email protected]>--- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/events/core.c +2
-1@@ -13520,7 +13520,8 @@ static void perf_cgroup_attach(struct cgroup_taskset *tset)struct cgroup_subsys_state *css;cgroup_taskset_for_each (task, css, tset) -task_function_call (task, __perf_cgroup_move, task); +if (!task_function_call (task, __perf_cgroup_move, task)) +return ; }struct cgroup_subsys perf_event_cgrp_subsys = {Signature · 1 line
2.25.1
Quoted 7 lines · Peter Zijlstra
Quoted 2 lines · Li Zhong
Check the return value of
task_function_call(), which could be error code when the execution fails.How is terminating the cgroup task iteration a useful thing? Also coding style fail for not adding { }
Thanks for your reply! Skip and continue the execution is more appropriate here. Change it in v2 patch.
Quoted 23 lines
Quoted 23 lines
Signed-off-by Li Zhong <[email protected]>--- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/events/core.c +2
-2@@ -13520,7 +13520,8 @@ static void perf_cgroup_attach(struct cgroup_taskset *tset)struct cgroup_subsys_state *css;cgroup_taskset_for_each (task, css, tset) -task_function_call (task, __perf_cgroup_move, task); +if (!task_function_call (task, __perf_cgroup_move, task)) +return ; }struct cgroup_subsys perf_event_cgrp_subsys = { --2.25.1