Skip to content

Commit

Permalink
kmemtrace: Fix up tracer registration
Browse files Browse the repository at this point in the history
Commit ddc1637 ("kmemtrace: Print
binary output only if 'bin' option is set") ended up inverting the
error detection logic. register_tracer() returns 0 on success,
which this change caused to treat as an error, resulting in:

[    0.132000] Warning: could not register the kmem tracer

as well as bailing out of the initcall with an error value. This
restores the old logic.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <20090928075540.GD6668@linux-sh.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Paul Mundt authored and Ingo Molnar committed Oct 1, 2009
1 parent 3397409 commit f9ac5a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/kmemtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static int __init init_kmem_tracer(void)
return 1;
}

if (!register_tracer(&kmem_tracer)) {
if (register_tracer(&kmem_tracer) != 0) {
pr_warning("Warning: could not register the kmem tracer\n");
return 1;
}
Expand Down

0 comments on commit f9ac5a6

Please sign in to comment.