* [PATCH] tracing/boot: Fix an IS_ERR() vs NULL bug
@ 2020-01-17 5:30 Dan Carpenter
2020-01-17 23:59 ` Masami Hiramatsu
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-01-17 5:30 UTC (permalink / raw)
To: Steven Rostedt (VMware), Masami Hiramatsu
Cc: Ingo Molnar, linux-kernel, kernel-janitors
The trace_array_get_by_name() function doesn't return error pointers,
it returns NULL on error.
Fixes: 4f712a4d04a4 ("tracing/boot: Add instance node support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
kernel/trace/trace_boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index fa9603dc6469..cd541ac1cbc1 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -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;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tracing/boot: Fix an IS_ERR() vs NULL bug
2020-01-17 5:30 [PATCH] tracing/boot: Fix an IS_ERR() vs NULL bug Dan Carpenter
@ 2020-01-17 23:59 ` Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2020-01-17 23:59 UTC (permalink / raw)
To: Dan Carpenter
Cc: Steven Rostedt (VMware), Ingo Molnar, linux-kernel, kernel-janitors
On Fri, 17 Jan 2020 08:30:07 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The trace_array_get_by_name() function doesn't return error pointers,
> it returns NULL on error.
Good catch! It used to use trace_array_create() which returns err_ptr,
but trace_array_get_by_name() doesn't anymore.
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Thank you!
>
> Fixes: 4f712a4d04a4 ("tracing/boot: Add instance node support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> kernel/trace/trace_boot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
> index fa9603dc6469..cd541ac1cbc1 100644
> --- a/kernel/trace/trace_boot.c
> +++ b/kernel/trace/trace_boot.c
> @@ -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;
> }
> --
> 2.11.0
>
--
Masami Hiramatsu <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-17 23:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 5:30 [PATCH] tracing/boot: Fix an IS_ERR() vs NULL bug Dan Carpenter
2020-01-17 23:59 ` Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).