tracing/boot: Fix an IS_ERR() vs NULL bug
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 17 Jan 2020 05:30:07 +0000 (08:30 +0300)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 21 Jan 2020 23:41:39 +0000 (18:41 -0500)
The trace_array_get_by_name() function doesn't return error pointers,
it returns NULL on error.

Link: http://lkml.kernel.org/r/20200117053007.5h2juv272pokqhtq@kili.mountain
Fixes: 4f712a4d04a4 ("tracing/boot: Add instance node support")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_boot.c

index fa9603dc6469829cfcf6663a3d9220c865efe8be..cd541ac1cbc1e9eb0b2404e056a2ec25bb2e89fe 100644 (file)
@@ -322,7 +322,7 @@ trace_boot_init_instances(struct xbc_node *node)
                        continue;
 
                tr = trace_array_get_by_name(p);
-               if (IS_ERR(tr)) {
+               if (!tr) {
                        pr_err("Failed to get trace instance %s\n", p);
                        continue;
                }