Fix: tracepoint: do not warn on ENOMEM
Subsystems (2)
Mathieu Desnoyers
reviewerPATCH 1/1 Fix: tracepoint: do not warn on ENOMEM
Tracepoint should only warn when a kernel API user does not respect the required preconditions (e.g. same tracepoint enabled twice, or called to remove a tracepoint that does not exist).
Silence warning in out-of-memory conditions, given that the error is returned to the caller.
This ensures that out-of-memory error-injection testing does not trigger warnings in tracepoint.c, which were seen by syzbot.
Signed-off-by Mathieu Desnoyers <[email protected]>
Reported-by [email protected]
Reported-by [email protected]
CC Steven Rostedt <[email protected]>
CC Ingo Molnar <[email protected]>
CC Peter Zijlstra <[email protected]>
CC Jiri Olsa <[email protected]>
CC Arnaldo Carvalho de Melo <[email protected]>
CC Alexander Shishkin <[email protected]>
CC Namhyung Kim <[email protected]>
--- kernel/tracepoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/tracepoint.c +2 -2
@@ -207,7 +207,7 @@ static int tracepoint_add_func(struct tracepoint *tp, lockdep_is_held(&tracepoints_mutex)); old =func_add (&tp_funcs, func, prio);if (IS_ERR (old)) { -WARN_ON_ONCE (1 ); +WARN_ON_ONCE (PTR_ERR (old) != -ENOMEM );return PTR_ERR (old); }
@@ -239,7 +239,7 @@ static int tracepoint_remove_func(struct tracepoint *tp, lockdep_is_held(&tracepoints_mutex)); old =func_remove (&tp_funcs, func);if (IS_ERR (old)) { -WARN_ON_ONCE (1 ); +WARN_ON_ONCE (PTR_ERR (old) != -ENOMEM );return PTR_ERR (old); }
Signature · 1 line
2.11.0